• 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: Prevent the appearance of the "Choose Application" dialog during compilation/execution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Prevent the appearance of the "Choose Application" dialog during compilation/execution


  • Subject: RE: Prevent the appearance of the "Choose Application" dialog during compilation/execution
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 13 Mar 2008 19:57:47 +0000

Hello List

I spoke to Chris Nebel of AppleScript Engineering about this off list.
His response included the following words of enlightenment with regards to the "Choose Application" dialog.

The official way to do this is to pass kOSAModeNeverInteract as a mode flag when calling OSACompile.  Unfortunately, OSAScript doesn't give you that level of control -- you'd have to call OSACompile yourself instead of using the OSAScript class.  However, that's not much additional code.

Failing that, it's possible to make the "choose application" fail:

- Make the process not allow user interaction.  osascript(1) does this, simply by virtue of being a command-line app; I'm not sure how you'd arrange this from a normal app, if indeed you can.

- Add an application handler for the "choose application" command (event code syso/ppcb), which will override the one from Standard Additions, and have it simply return errAEEventNotHandled.

- Install a custom Send function (use OSASetSendProc([[myScript language] componentInstance], mySendProc, ...)) that checks for syso/ppcb and immediately fails.  (Anything else is, of course, passed through as-is.)


On 12 March 2008 23:06:15 GMT "email@hidden" wrote

Hello list

Whilst compiling/executing against an application (say "duff") that cannot be found ie:

tell application "duff"
end tell

the "Choose Application" dialog appears.
I know why it appears and that it wants the application "duffs" dictionary, without which not much can happen.

But is it possible to request that in such cases compilation/execution simply fails?

I am compiling my scripts from within a cocoa app using the OSAScript class of the OSAKit:
OSAScript - (BOOL)compileAndReturnError:(NSDictionary **)errorInfo;

I don't mind digging down further into the OSA if a solution is in there somewhere.

Regards

Jonathan
 _______________________________________________
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

  • Prev by Date: Re: Vexing POSIX file issue
  • Next by Date: Double mounted afp volumes
  • Previous by thread: Re: Load script file
  • Next by thread: Double mounted afp volumes
  • Index(es):
    • Date
    • Thread