Re: alias list and class alst
Re: alias list and class alst
- Subject: Re: alias list and class alst
- From: Yvan KOENIG <email@hidden>
- Date: Tue, 15 Dec 2009 11:44:12 +0100
Le 15 déc. 2009 à 11:17, Tobias Exner a écrit : hi list, I've got a problem using code under leopard and tiger. I don't know exactly what's the problem, so let me ask you. The following code works with leopard ( 10.5.x ) tell application "Finder" set selectionList to the selection as alias list repeat with itemAlias in selectionList if (class of item itemAlias) is folder then set itemisfolder to "1" else set itemisfile to "1" end if end repeat but with tiger ( 10.4.11 ) I've got the following error: AppleScript Error: alias "Tiger:Users:tobias:Desktop:3050_0011.pdf" cannot be converted to type <<class alst>>
If I remember well, the coercion to alias list fails in old systems if the selection contains a single element.
try set selectionList to the selection as alias list on error set selectionList to {the selection as alias} end try
This piece of code will do the trick.
Yvan KOENIG (VALLAURIS, France) mardi 15 décembre 2009 11:44:06
|
_______________________________________________
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