Shirt Pocket Discussions

Shirt Pocket Discussions (http://www.shirt-pocket.com/forums/index.php)
-   General (http://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Do shell script erroring? (http://www.shirt-pocket.com/forums/showthread.php?t=1038)

Budgie 02-08-2006 03:31 PM

Do shell script erroring?
 
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
try
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"
activate
open file myFile
end tell

any ideas Dave?

Cheers
Budgie

dnanian 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...


All times are GMT -4. The time now is 04:31 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.