Trying to run a few shell commands, using the shell function, as follows:
on mouseUp
put shell ("cd /Users/davidneale/Documents/Web\ stuff/David\'s\ Web\ stuff/Telenet\ Webspace/elvis/originals/eBook")
put shell ("ls")
get shell ("zip -q0X ROE.epub mimetype")
get shell ("zip -qXr9D ROE.epub *")
end mouseUp
I put the put shell ("ls") in as a check, when I couldn't get the rest to work. This line actually does return a directory list, but it shows only the contents of the Revolution directory (in other words, the cd command was not executed correctly).
Can anyone tell me what I am doing wrong?
Running shell commands
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Running shell commands
The reason its not working as you intend is because each shell call starts a separate shell instance. Setting the directory in the first shell call has no impact on the subsequent shells.
If you do as Rrobert says that becomes a non-issue.
To get a visual of how this works, try a simple script like
If you do as Rrobert says that becomes a non-issue.
To get a visual of how this works, try a simple script like
Code: Select all
put shell ("cd /Users/davidneale ; ls") -- switch dir, and get a listing in the same shell.
put shell ("ls") --get a listing in a seperate shell. Should be back at the runrev default location.
Re: Running shell commands
Thanks for your help. Works fine now.