• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Symbolic link causing problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Symbolic link causing problems


  • Subject: Symbolic link causing problems
  • From: Philip Dow <email@hidden>
  • Date: Tue, 7 Mar 2006 21:39:21 +0100

I am calling a script from an application that imports a file into iTunes. I have a user reporting a problem that seems to concern a symbol link. His Users directory is actually a link (ln -s via terminal) to Users.original. The script refers to the location of the file it is trying to import as "File Root1:Users:xxx:Library:Application Support:Journler:temp:114014.mp3" but the app logs an error upon execution:

NSAppleScriptErrorMessage = "File Root1:Users:xxx:Library:Application Support:Journler:temp:114014.mp3 wasn't found.";
NSAppleScriptErrorNumber = -43;


The file does in fact exist. He has double checked this.

Is there an issue with symbolic links in AppleScript? If so, is there a simple way to solve this problem. The script follows, with the %@ replaced by the location of the file using the colon format:

BEGIN SCRIPT

global originalLoc
tell application "Finder" to set fs to name of startup disk & "%@" as alias
tell application "iTunes"
try
with timeout of 600 seconds

set addedTrack to (add fs)
set dbid to addedTrack's database ID
set myPlaylist to "Journler" as string

if not (exists playlist myPlaylist) then make new user playlist with properties {name:myPlaylist}

if not (exists (some track of playlist myPlaylist whose database ID is dbid)) then
duplicate addedTrack to playlist myPlaylist
end if

set originalLoc to location of addedTrack

end timeout
end try
end tell


tell me to return originalLoc as string

END SCRIPT

-Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: RE: IPTC info
  • Next by Date: RE: IPTC info
  • Previous by thread: Applescript for filmaker/entourage task
  • Next by thread: Re: TextEdit, is it really that lame?
  • Index(es):
    • Date
    • Thread