Re: Run script with arguments
Re: Run script with arguments
- Subject: Re: Run script with arguments
- From: Shane Stanley <email@hidden>
- Date: Tue, 30 Dec 2014 10:03:42 +1100
On 30 Dec 2014, at 9:20 am, Nicola Vitacolonna <email@hidden> wrote:
It seems as if run script forked a thread or a process but forgets to set its stdout.
AppleScript's log command does nothing of itself other than provide the logged information to the host running the script; it's up to the host what it does with it. If you add other commands to the run handler, they don't appear in Script Editor's event log either, so it's not surprising that log commands don't.
There's no problem with stdOut and no forked process, as this script shows:
use scripting additions
script Foo use framework "Foundation" on run argv repeat with i from 1 to (count argv) current application's NSLog("The value is: %@", item i of argv as text) end repeat return 42 end run end script
run script Foo with parameters {"a", 1}
OTOH, if you add a "use framework" statement to the top level of the above script, the "run script" call fails -- that looks to be a serious bug.
Is there some reason you need to call run? |
_______________________________________________
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