Launch Command

Sarah sarahr at genesearch.com.au
Wed Mar 19 18:45:01 EST 2003


Hi Roger,

I have actually been following this thread, but before it had seemed to 
me that your copy of TextEdit was in a folder called "GetIt". When your 
AppleScript confirmed that is was really in your normal Applications 
folder, it seemed that you had just been looking in the wrong place :-)

Now you have got me intrigued, so I wrote some scripts to help you work 
out what is going on. If you want me to send my demo stack, let me know:

Create a new stack and make 2 fields and 2 buttons:
In field 1, put the following Applescript:
tell application "Finder"
	choose file with prompt "Find TextEdit"
end tell

Leave field 2 empty.

Set button 1's script to:
on mouseUp
   do fld 1 as AppleScript
   put the result into appPath
   replace ":" with "/" in appPath
   replace quote with "" in appPath
   delete word 1 of appPath  -- alias
   delete last char of appPath -- :
   put "/" before appPath
   put appPath into fld 2

   launch appPath
   put the result
end mouseUp

Set button 2's script to:
on mouseUp
   launch fld 2
end mouseUp

(Usually I would give me field's descriptive names, but as this is only 
a test, I didn't bother.)

Now click button 1 - you should get a standard file selector dialog 
box. Choose TextEdit and click "OK". TextEdit should launch and the 
correct Revolution path to it should go into field 2. If you quit 
TextEdit and then click button 2, TextEdit should launch automatically 
without any file selection.

Using AppleScript's file selector works better for OS X app since it 
seems to understand better that they need to be treated as files event 
though they are really applications.

Let's hope it works this time :-)
Sarah


On Thursday, March 20, 2003, at 01:14  am, Roger Guay wrote:

> Thanks, Sarah.  You've joined this thread on the second or third 
> revolution.  I started with slashes (/) and I've known all along where 
> the application is, but I can't get the Launch Command to work.  
> launch "Macintosh HD/Applications/TextEdit.app" does not work on my 
> OSX 10.2.4 running Revolution 1.1.1.   I guess no one else has this 
> problem and I must appear to be a nut case.  Oh well!!
>
> Roger
>
> Message: 4
>> Date: Wed, 19 Mar 2003 15:45:46 +1000
>> Subject: Re: Launch Command
>> From: Sarah <sarahr at genesearch.com.au>
>> To: use-revolution at lists.runrev.com
>> Reply-To: use-revolution at lists.runrev.com
>>
>> In order to be consistent across all platforms, Revolution uses a 
>> slash
>> "/" as the delimiter for file paths, in your case over-riding the
>> normal Mac colon ":".
>>
>> Now that you have located the application, I think the following 
>> should
>> work:
>> 	launch "Macintosh HD/Applications/TextEdit.app"	(Rev 1.1.1)
>> or	launch "/Applications/TextEdit.app"				(Rev 2.0)
>>
>> Note that because of the peculiar nature of OS X application bundles,
>> checking for the existence of a file will fail. Check instead for a
>> folder if you are looking for an application.
>>
>> e.g. there is a file "Macintosh HD/Applications/TextEdit.app"  -- 
>> false
>> 	there is a folder "Macintosh HD/Applications/TextEdit.app"  -- true
>>
>> Hope this helps,
>> Sarah
>>
>>
>> On Wednesday, March 19, 2003, at 02:43  pm, Roger Guay wrote:
>>
>>>
>>> On Tuesday, March 18, 2003, at 05:56  PM,
>>> use-revolution-request at lists.runrev.com wrote:
>>>
>>>> do "choose file" as applescript
>>>> put  the result
>>>
>>> Ok, At least I can get the result:   "Macintosh
>>> HD:Applications:TextEdit.app:"
>>>
>>> If I then type:
>>>
>>> 			launch "Macintosh HD:Applications:TextEdit.app:"
>>>
>>> into the message box, I get error-35.  What the heck is going on???
>>>
>>> Thanks, Roger
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>





More information about the use-livecode mailing list