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 12:40:33 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
Hey Walter,

Oops.  I left in the 'as alias' coercion from the Mavericks version.  Here's the correct version.

-------------------------------------------------------------------------------------------
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")
end tell

makeAliasList(fileList)

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

It's a trifle faster with the conversion code directly in the script rather than in a handler.

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

tell application "Finder"
	set _target to target of front window as alias
	set fileList to (files of _target whose name extension is "dmg")
	
	repeat with i in fileList
		set contents of i to (i as alias)
	end repeat
	return fileList
end tell

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

--
Best Regards,
Chris

ATOM RSS1 RSS2