General Question

AppleScript: get and reformat current date, then insert it in any text field?
Hi,
I’m about to create an AppleScript that can reformat the current date into a YY-MM-DD string and then insert the result in any active text field.
Here’s exactly what I want:
1. Get the current date.
2. Reformat and convert that date to a YY-MM-DD string.
3. Insert that string into a text field via System Events keystrokes.
So far, I’ve only figured out step 3:
tell application “System Events” to keystroke current_date
Step 1 is also faitly obvious, but I’m stuck in step 2 – on how to reformat the date into something less verbose.
Observing members:
0
Composing members:
0


3 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.
Have a question?
Ask Fluther!