Re: Path to folder list
Re: Path to folder list
- Subject: Re: Path to folder list
- From: Richard Allaway <email@hidden>
- Date: Wed, 30 Nov 2005 13:41:19 -0500
On Wednesday, November 30, 2005, at 12:17PM, Gonçalo Miguel <email@hidden> wrote:
>Thanks Richard this helps a lot
>but let me ask another thing, if my need change to the Path of the
>folder inside those that we get from the list, like this:
>
>set newArchive to choose folder with prompt "Escolhe a pasta das Obras
>Concluídas"
>tell application "System Events"
> set the item_list to (get path of every folder INSIDE of newArchive
>whose visible is true)
>end tell
>
>tell application "DropStuff"
> stuff item_list format StuffIt with delete originals and individually
>end tell
>
>This because i have a folder (Obras Concluidas) that contains lots of
>folders (OBRXXXX) that contains one last folder and i need to stuff the
>last one only
>
First of all, I hope you didn't miss my second post. Here's how you can properly ignore invisible folders:
-----
tell application "System Events"
set the item_list to (get path of every folder of newArchive whose visible is true and name does not start with ".")
end tell
-----
The 'whose visible is true' doesn't actually do what one would expect, as far as I can see. I'm sure there's some good reason for that but I don't know what it is. Luckily, specifying 'name does not start with "." ' does the job for us.
As for your question: If I understand you correctly, you want to be treat these folders as folders, rather than just strings of Unicode text (which is what System Events' 'path' property gives us.) To do that you have two options. Either you can coerce a path string into an alias:
-----
set myAlias to last item of item_list as alias
-----
or, and I think this will be better for your purposes, just ask System Events for a list of folders in the first place:
-----
tell application "System Events"
set the item_list to (get every folder of newArchive whose visible is true and name does not start with ".")
end tell
-----
... that will give you a list of System Events' own-brand folder references. You can always have System Events convert those references into paths later. Have a look at its dictionary to see what else System Events can do with folders.
--Richard
_______________________________________________
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