Re: Folder or File?
Re: Folder or File?
- Subject: Re: Folder or File?
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 23 Jun 2011 18:53:03 -0500
- Acceptlanguage: en-US
- Thread-topic: Folder or File?
In brief, an item is a reference to a file or a container (folder, drive,
remote volume) that appears in a finder window or on the desktop.
The reference is in this format:
item "volume:folder:name"
The part in quotes is a plain old text string.
If the item in question is a file, then
file "volume:folder:name"
works too. I use item when the command may refer to a folder, a volume or a
file. It's flexible in that it doesn't care if the object is a container or
a file.
To coerce it to an alias you could do:
item "volume:folder:name" as alias
or
alias "volume:folder:name"
You shouldn't do:
item alias "volume:folder:name"
(This is what the example posted earlier was doing via a variable)
To coerce from an alias you could do
set myItem to item (alias "volume:folder:name" as text)
HTH,
ES
On 6/23/11 4:18 PM, "Gil Dawson" <email@hidden> wrote:
> Thanks for the insight, Shane.
>
> I'd like to learn more about Finder's "item". I have a pdf file dated 6/18/10
> of a book named "AppleScript Finder Guide". Is this the best place for me to
> read about Finder's "item"?
>
> --Gil
>
>
> On Jun 23, 2011, at 3:55 PM, Shane Stanley wrote:
>
>> On 24/6/11 8:26 AM, "Luther Fuller" <email@hidden> wrote:
>>
>>> You should do this ...
>>>
>>> set FolderA to (item 1 of FolderList) as alias
>>> set FolderB to (item 2 of FolderList) as alias
>>>
>>> And after it, insert this or something similar ...
>>>
>>> tell application "Finder"
>>> if class of item FolderA is not folder then return
>>> if class of item FolderB is not folder then return
>>> end tell
>>
>> If you are going to use Finder's "item", FolderA/FolderB should be strings,
>> not aliases.
>>
>> --
>> Shane Stanley <email@hidden>
>> 'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
>>
>>
>> _______________________________________________
>> 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:
> com
> 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