Got some problems makeing a script repeat some shell commands
i got a shell script called Backup.sh i my home folder, and i need an AS
that will run this shell script every 3H, when is use this command
do shell script (“Backup.sh”)
the script is NOT working, if i run ./Backup.sh from Terminal it works fine.
What is the specific error that you are receiving?
Can you post the contents of the script itself? Occasionally some scripts need modification when running from within an AppleScript. One large resaon for this is “do shell script” operates within the “sh” shell which, generally, is not a users default shell.
as of now im using the script you gave me.
and since my backup.sh is working direct from Terminal i guess the error must be located in the AS script
im not getting any errors, my backup.sh script does mount my image, but i cant access it. i can if using Terminal.
so i guess i must get Terminal to run the process, but, since im using Terminal for irssi, i dont what to interfere whit that.
Well given the only real AppleScript command is to run your script and part of it is working, the volume is mounting afterall, I would guess the issue is not with AppleScript itself, but rather the shell script when run from within Applescript.
If possible I would suggest pathing out your commands used within your shell script and then give it another go.
I agree with James; the next test should be something like this:
set shell_script_path to "/Users/casdvm/bin/Monday.sh"
do shell script (quoted form of shell_script_path)
You should also consider setting the do shell script to a variable, since you have an echo command in there, just in case there is a string to return:
set shell_script_path to "/Users/casdvm/bin/Monday.sh"
set shell_reply to do shell script (quoted form of shell_script_path)
display dialog shell_reply
Okay, maby not if used in script editor it is working, as soon as i save as an .app
i get the same problem as before, if run from script editor it is working
on run
Backup()
end run
on idle
Backup()
return 10800
end idle
on Backup()
set shell_script_path to "/Users/mkh79/Deamons/Backup.sh" as text
do shell script (quoted form of shell_script_path)
end Backup
So when you save it as an app what part is not working? It doesn’t run at all? OR It doesn’t repeat every 3 hours. Remember that you need to save your app with the “stay open” setting.