Re: Issuing commands to shell
Re: Issuing commands to shell
- Subject: Re: Issuing commands to shell
- From: Alex Zavatone <email@hidden>
- Date: Fri, 09 Nov 2012 08:45:50 -0500
Ahh, perfect. The first one is verified to work. Thanks much.
on PauseSafari() set myShellString to "set +o posix; kill -SIGSTOP " & pSafariPID set myResult to do shell script myShellString
set myShellString to "set +o posix; kill -SIGSTOP " & pSafariWebContentPID do shell script myShellString end PauseSafari
on ResumeSafari() set myShellString to "set +o posix; kill -SIGCONT " & pSafariPID do shell script myShellString set myShellString to "set +o posix; kill -SIGCONT " & pSafariWebContentPID do shell script myShellString end ResumeSafari
On Nov 9, 2012, at 4:38 AM, Axel Luttgens wrote: Le 9 nov. 2012 à 00:12, Alex Zavatone a écrit : I just found out that my Safari pause and resume script doesn't work since the shell commands I'm executing are erroring out.
What works in the Terminal:
kill -SIGSTOP 580
Returns this when I try to issue a do shell script:
do shell script "kill -SIGSTOP 580"
--> error "sh: line 0: kill: SIGSTOP: invalid signal specification"number 1
Any ideas on what I need to escape to make this work?
Hello Alex, Looks like to be a posix compliance matter; "do shell script" launches sh (as emulated by bash) in posix mode. So, either one disables the posix mode: do shell script "set +o posix; kill -SIGSTOP 580" or one invokes the kill builtin without prepending the signal name with SIG: do shell script "kill -STOP 580" Axel
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden