help with weekday true/false value in variable

Posted on
Sat Jan 18, 2014 10:29 pm
Indy_Larry offline
Posts: 133
Joined: Dec 03, 2013
Location: Indianapolis

help with weekday true/false value in variable

I'm trying to get this applescript to set the true / false value in my weekdays variable.
But it keeps telling me no result was returned.

Code: Select all
set today to current date
set weekdays to {Monday, Tuesday, Wednesday, Thursday, Friday}
set weekends to {Saturday, Sunday}
tell application "IndigoServer"
   if weekday of (current date) is in weekdays then
      set value of variable "Weekday" to "true"
   else if weekday of (current date) is in weekends then
      set value of variable "Weekday" to "false"
   end if
end tell
Attachments
Screen Shot 2014-01-18 at 11.25.00 PM.png
Screen Shot 2014-01-18 at 11.25.00 PM.png (79.77 KiB) Viewed 963 times

Posted on
Sat Jan 18, 2014 11:49 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: help with weekday true/false value in variable

This is a total guess, but I just pasted your script into the AppleScript editor and "weekdays" was colored blue as if it were a reserved word (variable names were green). You might try renaming the variable to see if that fixes you up. IF that is the case, then you might be able to test using it (if it were an array of constants or something).

Maybe someone with actual AppleScript experience can chime in if that doesn't work for you.

Posted on
Sun Jan 19, 2014 10:49 am
Indy_Larry offline
Posts: 133
Joined: Dec 03, 2013
Location: Indianapolis

Re: help with weekday true/false value in variable

RogueProeliator wrote:
This is a total guess, but I just pasted your script into the AppleScript editor and "weekdays" was colored blue as if it were a reserved word (variable names were green)


Thanks RogueProeliator, changed the set name to "day_of_week" and it is working. Again thanks for your help.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 9 guests