Re: get type of selected finder item
Re: get type of selected finder item
- Subject: Re: get type of selected finder item
- From: Luther Fuller <email@hidden>
- Date: Thu, 23 Apr 2009 10:54:28 -0500
On Apr 23, 2009, at 10:33 AM, Tobias Exner wrote: I'm searching through the web since some hours but can't find any solution... so I'm going to post it here. In a little applescript I want to use a selected file or folder from finder. That's quite easy: tell application "Finder" set this_item to the selection as alias display dialog this_item as string end tell but I want to know if the selected item is a file or a folder. Depending on this info the script would work in another way.
You need to test the selection to see if it contains just one item and that item is a folder. Run this ...
tell application "Finder" set selectionList to the selection as alias list repeat with itemAlias in selectionList if (class of item itemAlias) is folder then beep delay 1 end if end repeat end tell
The '... as alias list' is necessary. Without it, the selectionList contains references. Aliases are easier to work with.
|
_______________________________________________
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