Another way (attached)...I want to run a macro on every last Sunday of the month at a specific time. Is there any way to determine the last Sunday or for that matter any day which is the last day of the month?
The logic is quite simple: if today's date + 7 days (according to the day of week selected in the trigger) is in the same month as current date, i e. today is not the last occurrence of the month. Otherwise, it's the last one because next one will occur on another (next) month/year.Another way (attached)...
Very beautifulThe logic is quite simple: if today's date + 7 days (according to the day of week selected in the trigger) is in the same month as current date, i e. today is not the last occurrence of the month. Otherwise, it's the last one because next one will occur on another (next) month/year.
Local string variable 's' is used to store the result of the Shell script date. As it returns a 2 digit string value (from 01 to 12) it is then converted to a numeric value to be compared with the Magic text [month_digit] which is numeric.Very beautiful
But I don't understand where the string variable 's' is written.
Could you please explain?
Clear, thanks.Local string variable 's' is used to store the result of the Shell script date. As it returns a 2 digit string value (from 01 to 12) it is then converted to a numeric value to be compared with the Magic text [month_digit] which is numeric.
Sure. Please, find it attachedI
next2Sure. Please, find it attached.
Thanks for the explanation. Being a newbie can you please let me know how to remove the leading 0?[month_digit] has value 08 (notice the leading 0)
however cal does not like the leading 0 and returns
cal: not integer: 08
the text extractions that follow return 08 (the last number in the above error message)
and the resulting calculation is 8 - 17 => -9
and then everything is wrong (well it was wrong from start )
you must remove the leading 0 from the month
Text manipulation action > replace>source text would be a variable, text to replace is 0 and text toceeplace it with leave blank. Set the output to the variableThanks for the explanation. Being a newbie can you please let me know how to remove the leading 0?
Got it. Had to use regular expression so as to avoid replacing the zero for the month of October.Text manipulation action > replace>source text would be a variable, text to replace is 0 and text toceeplace it with leave blank. Set the output to the variable
Thanks. Will download and check it out.Please, find just published "Run actions on last Wednesday of the month" macro on Templates.