Multiple buttons running on one interface calling shell scripts
Multiple buttons running on one interface calling shell scripts
- Subject: Multiple buttons running on one interface calling shell scripts
- From: Ian Mcginley - Systems Support Engineer <email@hidden>
- Date: Thu, 23 Oct 2003 10:54:51 +1000
Hey guys again :)
Something slightly more advanced than last time. I've got an interface
which has two buttons, one marked "copy" and one marked "stop" (also
happening to be their applescript names).
I've found that with one button in an Applescript I do get funky stuff
to happen with code like :
on clicked copy
set source to contents of "cd_source" of window "setup"
set dest to contents of "cd_dest" of window "setup"
do shell script "export SOURCE=" & source & ";export DEST=" & dest &
"; ~/copy_media.sh > /dev/null 2>&1 & echo $1"
end clicked
However! :) If I wanted to stop this process (can take in excess of 40
minutes to occur if the source is a dvd) I tried to add:
on clicked stop
do shell script "kill_copy_media.sh"
end clicked
But it doesn't like that, when I do a command-k for syntax check in
Project Builder/Applescript Studio I get "Syntax Error : The clicked
handler is specifed more than once."
So my thought here is... how can get around this... can I only have one
"on clicked" per applescript file? do I generate a second applescript
file called stop_copy_media.applescript, or is there another cleaner way
around this? I know with programming there are many ways to cut the code
but whats the general thoughts here?
--
Ian McGinley
Systems Support Engineer
Sun Microsystems Australia
476 St Kilda Road - Melbourne - Australia - 3004
Ph: (03) 8866 6360 Email: email@hidden
UNIX is user-friendly, it is just picky about its friends
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.