r/applescript • • Jul 20 '21
Apple Script Date output in language other than the system language
Hi Community,
I'm working on an Apple Script to use in Textexpander, that inserts me the next day (or the one after that, should it happen to be a Sunday) into a Shipping confirmation for some stuff I sell on a page online. That all works fine so far, but since I'm using my Mac in english, for various reasons, and need to send the text in German, the english Date looks out of place and feels weird.
So is there a way to translate the Date I get as a result of my Apple Script automatically to German, without having to change my system language?
Many thanks in advance! :D
1
u/mad_scrub Jul 20 '21 edited Jul 20 '21
I don't think that will be easy with plain AppleScript... you can look into ASObjC's NSDateFormatter if you really care about the format.
If you're not picky about the format, you can use the `date` command line tool like this:
1
u/Identd Aug 19 '21
Do you need the returned data to be a date object, or is text OK?
1
u/copperdomebodha Jul 20 '21 edited Jul 20 '21
I think this could serve as long as you're not beating on the service repeatedly. Play nice!