MACSCRPT Archives

March 2008

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:
Emmett Gray <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 4 Mar 2008 10:56:27 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
I've found a bug (10.4.11) which is probably still in Leopard since I 
looked at the Leopard bug fix technote and it's not mentioned. I've 
reported the bug to Apple.

If the target folder of the "list folder" command has a name longer 
than 32 characters you get a "bad filename" error. I can't use the 
Finder to get the info because the very reason I'm needing the 
command for is to force the lazy Finder to update the contents of the 
folder!

I came up with the following workaround, with finderPath as the 
colon-delimited path of the target as text:

set oldDelims to Applscript's text item delimiiters
set Applscript's text item delimiiters to return
set folderContents to (every item of (do shell script "ls -1 " & 
quoted form of (POSIX path of finderPath)))
set set Applscript's text item delimiiters to oldDelims
--force the Finder to update
tell application "Finder"
repeat with thisItem in folderContents
update alias (finderPath & thisItem)
end repeat
end tell

--Emmett

ATOM RSS1 RSS2