Re: make new alias -- weird behavior
Re: make new alias -- weird behavior
- Subject: Re: make new alias -- weird behavior
- From: Luther Fuller <email@hidden>
- Date: Tue, 15 Feb 2011 08:37:52 -0600
On Feb 15, 2011, at 8:04 AM, Joel May wrote: The only way to create the alias is to use AppleScript talking with Finder.
Here's the code:
tell application "Finder" set macSrcPath to POSIX file "/Applications/MyProduct/doodle/doodle.tag" as text set macDstFolder to POSIX file "/Library/Application Support/MyCompany/MyProduct" as text make new alias at folder (macDstFolder as text) to (macSrcPath as alias) with properties {name: "doodle.tag alias"} end tell
This usually works, but it occasionally fails. Here's what happens:
Try this first ...
tell application "Finder" set macSrcPath to (((path to applications folder) as text) & "MyProduct:doodle:doodle.tag") as alias set macDstFolder to (((path to application support from local domain) as text) & "MyCompany:MyProduct:") as alias make new alias file at macDstFolder to macSrcPath with properties {name:"doodle.tag alias"} end tell
Always use aliases, not text paths except where necessary. Never use a posix path when a colon delimited path will work.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden