Create alias from CDROM to desktop?
Ken Ray
kray at sonsothunder.com
Thu May 6 13:39:22 EDT 2004
> > I've got a CD-ROM that has a Revolution app running on it,
> and I want
> > that Revolution app to create an alias, pointint to itself to the
> > user's desktop. I know that I can use the defaultFolder to find the
> > path to the app, and I know I can use "the
> specialFolderPath" to find
> > the path to the desktop. Can anyone tell me how I could pass these
> > parameters to Applescript to perform the alias creation?
> Will I run
> > into issues with the difference in how Applescript vs. Rev
> handles the
> > "/Volumes/" string, or how the CD-ROM path is formed?
>
> Is there a reason you can't use the create alias command in Rev?
Yes, unfortunately there's a bug in Bugzilla (#1059) about the inability to
make aliases to apps in OS X because they are "folders", and 'create alias'
only works with files.
You can use the revMacFromUNIXPath functions to convert the '/'-delimited
paths to ":"-delimited ones that Applescript likes. You can then do this:
put "tell app" && q("Finder") & cr & \
"set tFile to" && q(tPathToApp) & cr & \
"make new alias file at" && pAliasPath && "to tFile" & cr & \
"set the name of (the result) to" && q(tAliasName) & cr & \
"end tell" into tScript
do tScript as AppleScript
Oh, q() is my function that wraps quotes around things:
function q pWhat
return quote & pWhat & quote
end q
HTH,
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode
mailing list