Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Avoid application launch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid application launch



Hi,

    Can you please explain how we can set relaunch property (Never/Always) through Objective C or apple script. How we can change the behavior of AS which automatically launch a non-running application before sending it a command ?. And I am using apple script with objective C. Using NSAppleScript class for running apple script.

Thanks & Regards,
Joby Abraham.


> So you want to do something without doing something for it? You can't stop the execution just when Entourage stops. The only thing you can do is make sure the applescript does not do anything when Entourage has stopped, which you can do by checking the "running" flag inside the applescript. That's it.

The OP doesn't say what his application is written in. If it's pure AppleScript then his only option is to check the 'running' property before sending commands, as you say, since AS will always automatically launch a non-running application before sending it a command. (Plus he's posting to the wrong list; pure AS discussion belongs on applescript-users.)

OTOH, if it's an Objective-C based app that calls into AppleScript for interacting with other applications, he could port the AS part to objc-appscript. Appscript provides greater control over application relaunching behaviour: by default, only run commands relaunch an application that quits part way through, though you can set it to never relaunch or always relaunch if you prefer. Of course, you still need to check any command results for errors (though you should be doing that anyway in ObjC), so it won't make his code any shorter

HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



--
Joby Abraham|Sr. Software Engineer|Sourcebits Technologies Pvt. Ltd.|# 63, 2nd Floor, 19th Main,Rajajinagar 2nd Block,Bangalore - 560010,India.|Mobile +919916738174
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Avoid application launch (From: has <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.