• 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: applescript - perl - intel vs G5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript - perl - intel vs G5


  • Subject: Re: applescript - perl - intel vs G5
  • From: Doug McNutt <email@hidden>
  • Date: Thu, 21 Feb 2008 15:17:06 -0700

At 21:36 +0100 2/21/08, Wayne Melrose wrote:
>HI,
>
>I have a perl CGI script that launches an applescript application on  its completion..
>
>In the perl script, the syntax is
>
>	system "open /path/to/applescript.app";
>
>I have tried to get it to work as a shell script, although it seems to  have a problem and there's a few other issues that I won't bother  going into right now.. Needless to say, launching this little app  seems to work fine 80% of the time..
>
>The other 20% is spent either getting an API permissions error where  it fails to run, and it also seems to crash on launch from time to  time..
>
>This script runs on 9 servers that are configured very much the same  way, the thing I noticed today though, is that the all the G5 servers  never get the crashes or errors, and the intel machines do!?
>
>All servers are running Leopard.

The perl system call probably opens an instance of sh to execute the open call. It's possible that faster machines are somehow allowing the perl script to end before the new sh gets around to executing the open command.

You might add some delay before quitting or do something like:

$result = `open /path/to/applescript.app`;
print "$result\n";

to see if you're getting a reply or error code.

I use calls to osascript from perl regularly but the scripts are short and can usually be included with a "here" document passed as stdin to osascript. I'm also not on a fast new Mac.

AppleScript applications made by saving as app from within ScriptEditor are phunny apps that aren't really application bundles. They start with a 32 bit pronouncable hex code and in some conditions can have their execute bits set and be executed from perl or sh without using the open tool. It's conceivable that the open tool is getting confused by the lack of execute permission.

--

--> From the U S of A, the only socialist country that refuses to admit it. <--
 _______________________________________________
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: 
 >applescript - perl - intel vs G5 (From: Wayne Melrose <email@hidden>)

  • Prev by Date: Re: write file to /Library/Preferences
  • Next by Date: Re: AppleScript-Users Digest, Vol 5, Issue 123
  • Previous by thread: applescript - perl - intel vs G5
  • Next by thread: write file to /Library/Preferences
  • Index(es):
    • Date
    • Thread