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 11:17:51 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
I left out the word "text" in the line "set folder contents..."; it should read
set folderContents to (every text item of (do shell script "ls -1 " & 
quoted form of (POSIX path of finderPath)))

At 11:15 AM -0500 3/4/08, Emmett Gray wrote:
>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