Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > VERY BASIC applescript help

VERY BASIC applescript help
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2001
Location: berkeley, ca, USA
Status: Offline
Reply With Quote
Feb 6, 2001, 11:54 PM
 
I need help with applescript in OS 9.0.4. I made a simple launcher
for a game program using applescript:

tell application "GAME" to run params "Entry.unr INI=Game.ini USERINI=GameUser.ini"

That's it. But, since I have multiple copies of the application "GAME" in different folders, applescript never seems to pick the right one. Is there a way to make sure my script finds the right app when I launch the script? Thanks in advance!

- applescript NEWBIE.
     
Forum Regular
Join Date: Nov 2000
Location: Madison , WI
Status: Offline
Reply With Quote
Feb 7, 2001, 08:03 PM
 
What if you just changed the name to "Game " (notice the empty space after the name) and told the script to activate "Game "?

This may not be the best way possible,but I bet it would work.
     
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Feb 7, 2001, 11:19 PM
 
Hi mallard,

Another possibility might be to hard-code, in the 'tell application ...' statement, the full pathname of the preferred copy of the "GAME" app, using the standard colon-separated pathname format -- e.g., 'tell application "MyVolume:MyFolder:MySubfolder:GAME" to ...'. However, note that this approach would be less flexible than Yuril419's above suggestion of using a unique app-name, as it may break if you ever move the preferred copy of the "GAME" app to a new location.

An alternative possibility that wouldn't require specifying a full pathname might be to keep the launcher applet in the same folder as the preferred copy of the "GAME" app. (You could then keep an alias of the applet in a more convenient location.) That way, since AppleScript is supposed to look for the app first in the "current directory", it should always pick the applet's sibling "GAME" app. [Update 2001/02/09:- Hmmm, according to Apple, this approach might also be problematic. Chapter 5, "Objects and References" of Apple's official AppleScript Language Guide mentions that the "current directory" may be affected by the settings in (the 'Documents' section of) the General Controls control panel.]

Regards,

--Paul

[This message has been edited by Paul Crawford (edited 02-09-2001).]
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2