add time stamp to file name

Discussion in 'Mac Apps and Mac App Store' started by demuro1, Oct 17, 2012.

  1. demuro1 macrumors newbie

    Aug 20, 2007
    I am currently taking a programming class and they are teaching us java. I am using text wrangler as my editor and then I have an applescript I'm using to do the following

    -this applescript just sends the active text wrangler view to terminal and terminal compiles it.
    -the errors are output to a new text edit file i have named compile_log.

    I'd like the applescript to also add the date the document was last modified to the end of the file in the format YearMonthDayHourMinSec YYYYMMDDhhmmss

    does anyone have any idea on this

  2. kryten2 macrumors 6502a

    Mar 17, 2012
    Info : Dates & Times in AppleScripts
    or use the date command. Lookup the man page for date for more information.

    Example :

    -- In the format YearMonthDayHourMinSec YYYYMMDDhhmmss
    set theDate to do shell script "date +%Y%m%d%H%M%S"
    -- the result
    -- "20121017232332"

Share This Page