I want it so that if the current date matches the string, it will log "works!". However it doesn't seem to work.
set datesubmit to "27, May, 2016"
set trydate to {day, month, year} of (current date)
log (trydate)
log (datesubmit)
if trydate is equal to datesubmit then
log ("works!")
end if
I tried to make sure they are both string type variables but I can't get it to equal. This was the output:
(*27, May, 2016*)
(*27, May, 2016*)
Can someone tell me where I'm wrong?
Best Answer
After some trying I come to the conclusion that a
variable
setto {day, month, year} of (current date)
isn't a "string" with the form "day, month, year" but "daymonthyear".So you may change the script to
which is not very elegant.
Alternatively you may choose:
You always have to add the weekday in the first variable though.
The best proposal (made by the OP itself) is: