• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Run script with arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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?

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Run script with arguments (From: Nicola Vitacolonna <email@hidden>)
 >Re: Run script with arguments (From: Deivy Petrescu <email@hidden>)
 >Re: Run script with arguments (From: Nicola Vitacolonna <email@hidden>)

  • Prev by Date: Re: Run script with arguments
  • Next by Date: Re: Run script with arguments
  • Previous by thread: Re: Run script with arguments
  • Next by thread: Re: Run script with arguments
  • Index(es):
    • Date
    • Thread