Jump to content
Server Maintenance This Week. ×

perform script not skipping and exit


This topic is 2968 days old. Please don't post here. Open a new topic instead.

Recommended Posts

i am trying to write a script which fires on the first of the month. but it always fires no matter what the date.

 

trigger birthdays send
If
[ Date ( Month ( Get (CurrentDate) ) -0 ; 1 ; Year ( Get (CurrentDate) ) ) ]

Perform Script [ “Birthdays report this month” ]

Else

Exit Script [ ]

End If 

Link to comment
Share on other sites

Try

If[Get(CurrentDate) = Date ( Month ( Get (CurrentDate) )  ; 1 ; Year ( Get (CurrentDate) ) ) ]

Your calculation returns the date of the first of the month, which is always greater than 0, and therefore always true.

 

Edit:  Actually you could get away with just If[Day(Get(CurrentDate)) = 1]

Edited by doughemi
  • Like 1
Link to comment
Share on other sites

If you want to see if today is the first of the month, then you should test for:

Day ( Get (CurrentDate) ) = 1

Your test calculates the date of the first of the month, and places it inside an If[] - that will always return true.

Note also that if for some reason your script doesn't run on the first of the month (e.g. because it's weekend or a holiday), then the next earliest time the test will return true is a month from now. So you might offend all those whose birthday is this month.

 

 

 

Edited by comment
  • Like 1
Link to comment
Share on other sites

16 minutes ago, comment said:

If you want to see if today is the first of the month, then you should test for:


Day ( Get (CurrentDate) ) = 1

 

thanks for the answer, i have just started using FMserver and trying to get some PDF reports done in the back ground and as FMserver does not do PDF natively i will try to write an applescript to fire an ical  event on the first of the month.

Link to comment
Share on other sites

This topic is 2968 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.