The record is passed to the script
See the skeleton script below
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
<<< insert code
end repeat
end tell
end performSmartRule
I’d like to rename it to has the last day of that month
Here’s example code to get the last day of the month and rename the record
set theName to name of theRecord
set theName to theName & my LastDay(texts -6 thru -1 of theName)
set name of theRecord to theName
on LastDay(theDate)
set theyyyy to characters 1 thru 4 of theDate as string
set themm to characters 5 thru 6 of theDate as string
-- Convert to the first day of the following month
-- Then get the previous day
set NewDate to current date
set year of NewDate to theyyyy
set day of NewDate to 1
set month of NewDate to (themm as integer) + 1
set NewDate to NewDate - (1 * days)
return day of NewDate
end LastDay