MACSCRPT Archives

December 2013

MACSCRPT@LISTSERV.DARTMOUTH.EDU

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

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

Print Reply
Mime-Version:
1.0 (Mac OS X Mail 7.0 \(1822\))
Content-Type:
text/plain; charset=us-ascii
Date:
Wed, 11 Dec 2013 12:40:33 -0600
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Subject:
From:
Christopher Stone <[log in to unmask]>
Message-ID:
In-Reply-To:
Content-Transfer-Encoding:
quoted-printable
Sender:
Macintosh Scripting Systems <[log in to unmask]>
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