set Date to (do shell script "date ''+%Y-%m-%d-%H-%M-%S''")
return Date
this used to work, but now it won’t compile, is it cause I changed to lion? (The applescript seems to interpret the last few letters as a chinese character.) The shell script works in the terminal. The error message says “access not allowed”.
“Date” is a reserved word in AppleScript, and should not be used as a variable name. I have only vague ideas why your old code used to work, and now fails, so I won’t try to put them into words…