3 Replies Latest reply: Mar 29, 2011 3:41 PM by rccharles
eleve Level 1 Level 1 (75 points)
Hi, all,

My mom has started using a Mac (I think she's running 10.4.11 as well). She's asking if there is some kind of shortcut to bring the current date (or date/time) into a TextEdit document. So, that's question #1.

Question #2 is if TextEdit doesn't support that action, would it be something easily created with AppleScript (which I've never used...)?

Any help/suggestions most welcome. Thanks.

MacBook, 2 GHz Intel, 1 GB, Mac OS X (10.4.11)
  • Niel Level 10 Level 10 (268,800 points)
    Use the following AppleScript and copy/paste the result:

    (current date) as string

    (57489)
  • eleve Level 1 Level 1 (75 points)
    Thanks.

    So, I made that in ScriptEditor - how does she utilize that in TextEdit?
  • rccharles Level 5 Level 5 (6,025 points)
    Try this script:

    set the clipboard to (current date) as string

    Save the script as an applescript bundle. Place script in doc. Click on applescript in dock.

    use command+v
    to paste into any text editor.


    -------------

    The first thing that you need to do is to make the text into an AppleScript program.

    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor

    Copy the script text to the Applescript editor.



    Note: The ¬ is typed as option+return.It servers as a visual line end character.

    You may need to retype these characters.



    Save the text to a file as an application and do not check any of the boxes below.

    If you want access to the script from your Script Menu, move the script (the saved script application file) to your
    ~/Library/Scripts folder. You can also drag it to your Dock or make an alias for it on the Desktop.



    To debug, run the script within the Applescript Editor. Click on the event log tab at the bottom of the window. Click on the run icon. The results from the log statement will be shown at the bottom of the screen.


    ---------------