MACSCRPT Archives

December 2013

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Christopher Stone <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 11 Dec 2013 11:01:44 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
On Dec 11, 2013, at 09:12, Walter Ian Kaye <[log in to unmask]> wrote:
> It seems I can get either a whose clause filtered list of file objects *or* an alias list, but I can't seem to get both. Been trying various syntax.
______________________________________________________________________

Hey Walter,

As far as I know it can't be done pre-Mavericks.

However this does work on Mavericks:

-------------------------------------------------------------------------------------------
tell application "Finder"
	set _target to target of front window as alias
	set fileList to (files of _target whose name extension is "dmg") as alias list
end tell
-------------------------------------------------------------------------------------------

Pre-Mavericks this is what I used to do when I wanted to convert Finder-References to an alias list:

-------------------------------------------------------------------------------------------
on makeAliasList(_list)
	tell application "Finder"
		repeat with i in _list
			set contents of i to (i as alias)
		end repeat
		return _list
	end tell
end makeAliasList
-------------------------------------------------------------------------------------------

tell application "Finder"
	set _target to target of front window as alias
	set fileList to (files of _target whose name extension is "dmg") as alias list
end tell

makeAliasList(fileList)

-------------------------------------------------------------------------------------------

--
Best Regards,
Chris

ATOM RSS1 RSS2