Re: Invisible Unix "Icon" File
Re: Invisible Unix "Icon" File
- Subject: Re: Invisible Unix "Icon" File
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 15 Nov 2010 12:15:10 -0500
On Mon, Nov 15, 2010 at 10:52 AM, Luther Fuller <email@hidden> wrote:
> My script was getting a list of files in a folder using ...
> set AppleScript's text item delimiters to {return}
> do shell script "ls -tr " & (quoted form of (POSIX path of sourceFolder))
> set msgList to (text items of the result) as list
The ls command doesn't even output the filename in such cases;
non-printable characters just show up as question marks. So your list
of filenames will include the entry "Icon?", which doesn't exist as a
filename (although if you were using the shell, the wildcard pattern
"Icon?" would match the filename).
Try this:
set AppleScript's text item delimiters to {character id 0}
do shell script "find " & (quoted form of (POSIX path of
sourceFolder)) & " -depth 1 -print0"
set msgList to (text items of the result) as list
leave off the "-depth 1" if you want the contents of all folders and
subfolders under sourceFolder, recursively.
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden