Opening folders from Rev

Mike Brown mike at cyber-ny.com
Wed Oct 23 13:43:01 EDT 2002


Ken,

I did find through trial and error that this Apple Script works from both
the Script Editor and my Rev Stack:

tell application "Finder"
activate
open folder "Users:cyberny:Desktop:MyFolder"
end tell


I found that replacing all "/" with ":" and eliminating the "Macintosh HD"
from the start of the path enabled the script to work.

Does that make sense??  I will test further but it seems to work.  I don't
know AppleScript so it's a bit sketchy.

Now I just need a Windows solution.

- Mike


> From: Mike Brown <mike at cyber-ny.com>
> Reply-To: use-revolution at lists.runrev.com
> Date: Wed, 23 Oct 2002 14:12:25 -0400
> To: <use-revolution at lists.runrev.com>
> Subject: Re: Opening folders from Rev
> 
> Ken,
> 
> When I run that script through the Apple Script Editor I get the following
> execution error:
> 
> Finder got an Error: Can't get folder "Macintosh HD"
> 
>> From: "Ken Ray" <kray at sonsothunder.com>
>> Organization: Sons of Thunder Software
>> Reply-To: use-revolution at lists.runrev.com
>> Date: Wed, 23 Oct 2002 12:28:31 -0500
>> To: <use-revolution at lists.runrev.com>
>> Subject: Re: Opening folders from Rev
>> 
>> Mike,
>> 
>> Try putting the script into Apple's Script editor (sans all the Transcript
>> stuff) and see if it works from there:
>> 
>> -- Suppose your hard disk is named "Macintosh HD"
>> 
>> tell application "Finder"
>> activate
>> open folder "Macintosh HD"
>> end tell
>> 
>> If this doesn't work, let me know...
>> 
>> Ken Ray
>> Sons of Thunder Software
>> Email: kray at sonsothunder.com
>> Web Site: http://www.sonsothunder.com/
>> 
>> ----- Original Message -----
>> From: "Mike Brown" <mike at cyber-ny.com>
>> To: <use-revolution at lists.runrev.com>
>> Sent: Wednesday, October 23, 2002 12:20 PM
>> Subject: Re: Opening folders from Rev
>> 
>> 
>>> Hi Ken,
>>> 
>>> Still no luck.  I tried it on Mac OS 9.2, OSX and Win 98... no luck on all
>>> fronts.  I also tried minimizing the script for each specific OS to avoid
>>> mistakes but still no luck.
>>> 
>>> On Mac OS 9.2 the script does bring the Finder to the front but then
>> nothing
>>> else happens.  I created a test fld for the script and it is adding the
>>> appropriate path to the folder a sending the AppleScript message.
>>> 
>>> - Mike
>>> 
>>> 
>>>> From: "Ken Ray" <kray at sonsothunder.com>
>>>> Organization: Sons of Thunder Software
>>>> Reply-To: use-revolution at lists.runrev.com
>>>> Date: Wed, 23 Oct 2002 10:50:30 -0500
>>>> To: <use-revolution at lists.runrev.com>
>>>> Subject: Re: Opening folders from Rev
>>>> 
>>>> Mike,
>>>> 
>>>> I think you might need to add a colon to the path name in the "open
>> folder"
>>>> part of the applescript:
>>>> 
>>>> "open folder " & quote & pPath & ":" & quote & cr
>>>> 
>>>> Try that and let me know,
>>>> 
>>>> Ken Ray
>>>> Sons of Thunder Software
>>>> Email: kray at sonsothunder.com
>>>> Web Site: http://www.sonsothunder.com/
>>>> 
>>>> ----- Original Message -----
>>>> From: "Mike Brown" <mike at cyber-ny.com>
>>>> To: <use-revolution at lists.runrev.com>
>>>> Sent: Wednesday, October 23, 2002 8:44 AM
>>>> Subject: Re: Opening folders from Rev
>>>> 
>>>> 
>>>>> Hi Ken,
>>>>> 
>>>>> Thanks for the Script.. I can't get it to work though.  maybe I am
>>>>> implementing it incorrectly.  I am working on a Mac with OS X and 9.2
>> for
>>>>> Classic mode.  I have also tested on a Win 98 PC.  The script
>> accurately
>>>>> selects the folder path and assembles the Apple Script but nothing
>> happens
>>>>> after that.  Any other ideas?
>>>>> 
>>>>> Thanks,
>>>>> Mike
>>>>> 
>>>>> 
>>>>>> To: <use-revolution at lists.runrev.com>
>>>>>> Subject: Re: Opening folders from Rev
>>>>>> 
>>>>>> Mike,
>>>>>> 
>>>>>> You can do it completely with Transcript... here's a way to do it on
>>>>>> Windows, Mac OS X and OS 9. The Windows version is a little sneaky as
>> it
>>>>>> takes advantage of aliases, but it works nonethelss. I'll be posting
>>>> this
>>>>>> tip on my site tomorrow
>>>>>> (http://www.sonsothunder.com/revolution/revolution.htm?file009) as my
>>>> FTP
>>>>>> server is temporarily down, but in the meantime, here's the code:
>>>>>> 
>>>>>> on mouseUp
>>>>>> answer folder "Get a folder:"
>>>>>> if it <> "" then
>>>>>> OpenFolder it
>>>>>> end if
>>>>>> end mouseUp
>>>>>> 
>>>>>> on OpenFolder pPath
>>>>>> switch (the platform)
>>>>>> case "Win32"
>>>>>> create alias "C:/Temp.lnk" to file pPath
>>>>>> set the hideConsoleWindows to true
>>>>>> get shell("C:\Temp.lnk")
>>>>>> delete file "C:/Temp.lnk"
>>>>>> break
>>>>>> case "MacOS"
>>>>>> if the systemVersion >= 10 then
>>>>>> get shell("open " & pPath)
>>>>>> else
>>>>>> put "tell application " & quote & "Finder" & quote & cr & \
>>>>>> "activate" & cr & \
>>>>>> "open folder " & quote & pPath & quote & cr & \
>>>>>> "end tell" into tScript
>>>>>> do tScript as AppleScript
>>>>>> end if
>>>>>> break
>>>>>> end switch
>>>>>> end OpenFolder
>>>>>> 
>>>>>> Enjoy!
>>>>>> 
>>>>>> Ken Ray
>>>>>> Sons of Thunder Software
>>>>>> Email: kray at sonsothunder.com
>>>>>> Web Site: http://www.sonsothunder.com/
>>>>>> 
>>>>>> 
>>>>>> ----- Original Message -----
>>>>>> From: "Mike Brown" <mike at cyber-ny.com>
>>>>>> To: <use-revolution at lists.runrev.com>
>>>>>> Sent: Tuesday, October 22, 2002 2:25 PM
>>>>>> Subject: Opening folders from Rev
>>>>>> 
>>>>>> 
>>>>>>> Anyone know a method for popping open a folder (directory) from Rev
>> in
>>>> Win
>>>>>>> and/or Mac OS?  I want to allow users of my app to open a folder and
>>>> grab
>>>>>>> files while still in the Rev app.
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> Mike
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> use-revolution mailing list
>>>>>>> use-revolution at lists.runrev.com
>>>>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> use-revolution mailing list
>>>>>> use-revolution at lists.runrev.com
>>>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>> 
>>>>> _______________________________________________
>>>>> use-revolution mailing list
>>>>> use-revolution at lists.runrev.com
>>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>> 
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>> 
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> _______________________________________________
> 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