Re: get file not found when the file exists
Re: get file not found when the file exists
- Subject: Re: get file not found when the file exists
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 16 Dec 2013 15:26:16 -0800
- Thread-topic: get file not found when the file exists
Title: Re: get file not found when the file exists
It doesn't error here in OS 10.9. It gives the name of the (only or last) item in the folder.
Did you try dereferencing the variable in the repeat loop:
repeat with i from 1 to (count filesInApplications_Scripts)
set aPath to item i of filesInApplications_Scripts
(get name of disk item aPath)
end repeat
--
Paul Berkowitz
From: "koenig.yvan" <email@hidden>
Date: Sat, 14 Dec 2013 15:17:23 +0100
To: AppleScript-Users <email@hidden>
Subject: get file not found when the file exists
Hello
I'm really puzzled by the behavior of this script :
tell application "System Events"
set filesInApplications_Scripts to path of disk items of folder "~/Library/Containers/com.apple.BKAgentService/Data/Library/Application Scripts/" whose visible is true
--> {"Macintosh HD:Users:yvankoenig:Library:Containers:com.apple.BKAgentService:Data:Library:Application Scripts:com.apple.BKAgentService"}
repeat with aPath in filesInApplications_Scripts
(get name of disk item aPath)
end repeat
end tell
(*
Résultat :
error "Erreur dans System Events : Il est impossible d’obtenir disk item \"Macintosh HD:Users:yvankoenig:Library:Containers:com.apple.BKAgentService:Data:Library:Application Scripts:com.apple.BKAgentService\"." number -1728 from disk item "Macintosh HD:Users:yvankoenig:Library:Containers:com.apple.BKAgentService:Data:Library:Application Scripts:com.apple.BKAgentService"
*)
Here, it extracts a path from the source folder but when it's asked to grab the name of the item it claims tat it doesn't find it.
I coded a loop in case of there are several items in the source folder.
What may explain that ?
Funny feature, when I open the infos window for every symlink of the folder "~/Library/Containers/com.apple.BKAgentService/", it appears that they are pointing upon themselves.
Yvan KOENIG (VALLAURIS, France) samedi 14 décembre 2013 15:17:20
_______________________________________________
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
_______________________________________________
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