Re: trouble with files and folders in Finder
Re: trouble with files and folders in Finder
- Subject: Re: trouble with files and folders in Finder
- From: Yvan KOENIG via AppleScript-Users <email@hidden>
- Date: Sun, 17 Nov 2019 11:11:39 +0100
tell application "Finder"
log (path to music folder) as text
set UG to "Ug 2:"
# Your original instruction is wrong.
set path2Folder to ((path to music folder)) & UG -->{alias "SSD
1000:Users:**********:Music:", "Ug 2:"}
# It would be :
set path2Folder to ((path to music folder) as text) & UG --> "SSD
1000:Users:**********:Music:Ug 2:"
--set W to files of x
set Y to "After Ewe:Users:walterbushell:Music:UG:" as folder -- or as
alias etcetera
set Y to files of folder path2Folder --as alias
-- log Y
end tell
For my own use I would move some code out of the tell "Finder" block.
log (path to music folder) as text
set UG to "Ug 2:"
# Your original instruction is wrong. It doesn't create a path but a list.
set path2Folder to ((path to music folder)) & UG -->{alias "SSD
1000:Users:**********:Music:", "Ug 2:"}
# It would be :
set path2Folder to ((path to music folder) as text) & UG --> "SSD
1000:Users:**********:Music:Ug 2:"
tell application "Finder"
--set W to files of x
set Y to "After Ewe:Users:walterbushell:Music:UG:" as folder -- or as
alias etcetera
set Y to files of folder path2Folder --as alias
-- log Y
end tell
This said, there is an other problem. What is the real name of the target
subfolder ?
Is it "UG" or "Ug 2" ?
Given the error message I assume that the true name is "Ug 2".
Try to run:
set UG to "Ug 2:"
set path2Folder to (path to music folder as text) & UG --> "SSD
1000:Users:**********:Music:Ug 2:"
tell application "Finder"
if exists folder path2Folder then
set Y to files of folder path2Folder as alias list
else
error "The folder “" & path2Folder & "” doesn't exist!"
end if
end tell
If the subfolder "Ug 2" exists, it will return a list of aliases.
If the subfolder doesn't exist you will get the error message:
error "The folder “After Ewe:Users:walterbushell:Music:Ug 2:” doesn't exist!"
number -2700 from «script» to item
It's the meaning of the reported original error message.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche
17 novembre 2019 11:05:00
_______________________________________________
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