View Full Version : Do shell script erroring?

02-08-2006, 03:31 PM
Hi Dave
Im running the "do shell script" command with a apple script attached, that sends some basic text to a text file after SD has completed, the text file is located in a folder on my server, all permissions for the folder, plus the text file are set to"read and write" and are set to owner "admin", problem is that the script when run from SD fails, result is:

| 09:09:53 AM | Info | ...ACTION: Running shell script Send SD Report .scpt
| 09:09:53 AM | Info | ......COMMAND => Invoking site customization script: /Applications/SUPER DUPER/Send SD Report .scpt
| 09:09:53 AM | Error | sh: line 1: /Applications/SUPER DUPER/Send SD Report .scpt: Permission denied

but when run directly from script editor it works fine.
heres the apple script.

set myFile to ("ADMIN REPORTS:SD REPORTS:SD Report.txt")
set myDate to (current date) as text
set myName to long user name of (get system info) as text
set myComm to "SD Complete"
set theData to myDate & tab & tab & myName & tab & tab & myComm & return
close access file myFile
end try
open for access file myFile with write permission
write theData to file myFile starting at eof
close access file myFile
-------------this calls the text file for examination"-----------------
tell application "TextEdit"
open file myFile
end tell

any ideas Dave?


02-08-2006, 04:50 PM
You bet. A shell script is not the same as an AppleScript. You can call an AppleScript from a shell script using "osascript", but you can't call it "directly" as you did...