Re: Invisible Unix "Icon" File
Re: Invisible Unix "Icon" File
- Subject: Re: Invisible Unix "Icon" File
- From: Shane Stanley <email@hidden>
- Date: Tue, 16 Nov 2010 08:49:01 +1100
- Thread-topic: Invisible Unix "Icon" File
On 16/11/10 4:15 AM, "Mark J. Reed" <email@hidden> wrote:
> 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).
Actually, I think there's another quirk: the way do shell script does its
conversion of /n to /r swallows the /r after Icon. It's as if it does a
conversion of /r/n to /r as well as /n to /t. Thus the difference here:
set x to count (do shell script "ls -R /Applications/Utilities")
set y to count (do shell script "ls -R /Applications/Utilities" without
altering line endings)
return {x, y}
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
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