Weird result with OSProcess and Applescript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird result with OSProcess and Applescript

Sean P. DeNigris
Administrator
1. The following hangs forever. The output is there, but the process never completes
PipeableOSProcess waitForCommand: '/usr/bin/osascript -ss -e "tell application \"Safari\" to get source of current tab of window 1"'.

2. The same command in Terminal returns right away.

3. And this works:
PipeableOSProcess waitForCommand: '/usr/bin/osascript -ss -e "tell application \"Safari\" to get window 1"'.

So #2 would seem to rule out a problem with the command, and #3 with the connection between OSProcess and Applescript. I have no idea where to go from here...

sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Weird result with OSProcess and Applescript

Sean P. DeNigris
Administrator
So weird! Even compiling the script into a file and running it that way has the same result:

PipeableOSProcess waitForCommand: '/usr/bin/osascript -ss "/path/to/get_source_of_current_safari_tab.scpt"'

For now, I made a Ruby one-liner, using rb-appscript, that doesn't hang waitForCommand:, but I'm still curious...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Weird result with OSProcess and Applescript

Igor Stasenko
you're probably one of the few who using OSProcess plugin and in such fashion..
i'd willing to help, but i don't know much about OP implementation.
Maybe you will have some response if you post on vm-dev list?

On 24 February 2012 21:47, Sean P. DeNigris <[hidden email]> wrote:

> So weird! Even compiling the script into a file and running it that way has
> the same result:
>
> PipeableOSProcess waitForCommand: '/usr/bin/osascript -ss
> "/path/to/get_source_of_current_safari_tab.scpt"'
>
> For now, I made a Ruby one-liner, using rb-appscript, that doesn't hang
> waitForCommand:, but I'm still curious...
>
> --
> View this message in context: http://forum.world.st/Weird-result-with-OSProcess-and-Applescript-tp4415603p4418446.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>



--
Best regards,
Igor Stasenko.