Pass a date into Applescript

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Pass a date into Applescript Sun Jun 06, 2021 11:55 am • by tomkerswill
Hi

I'm passing a date attribute into my Applescript action, by using the Options button and selecting that attribute.

I'd like to be able to change the format of the date. Hazel's default date format isn't recognised by Applescript when doing things like setting the modified date of a file.

It's possible to change the format of attributes in other Hazel actions (such as renaming files). But I can't see how to do that when passing these into an Applescript action.

Tom
tomkerswill
 
Posts: 1
Joined: Sun Jun 06, 2021 11:50 am

Re: Pass a date into Applescript Mon Jun 07, 2021 9:46 am • by Mr_Noodle
Dates actually don't have a format. They are passed in as dates. I'm not sure what you are using in the script itself to manipulate the date but if it requires a date formatted as a string, you need to do that yourself.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support