Need help with an Applescript to insert current date

Hello,


tell application "System Events"
	keystroke day of (current date)
	keystroke space
	keystroke month of (current date) as string
	keystroke space
	keystroke year of (current date)
end tell

It results in “9 January 2015”. How can I get the month in my own (system) language, swedish?

Thanks

Fred

When you go to system preferences->language->date, you can change the short date to you liking. Then define the format you want and the only you need to do in AppleScript is.

tell application "System Events"
   keystroke short date string of (current date)
end tell

Thanks,
in system preferences->language->date my short date is “2015-01-09”
My long date is “5 januari 2015”, which is what I try to insert with the script.

I don’t want to edit the short since I use this as well.

This doesn’t work


tell application "System Events"
keystroke long date string of (current date)
end tell

Hi,

try this


set dateString to text from word 2 to -1 of date string of (current date)

Thanks, it worked!