Re: Pleas help with AppleScript's text item delimiter
Re: Pleas help with AppleScript's text item delimiter
- Subject: Re: Pleas help with AppleScript's text item delimiter
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 13 Sep 2003 23:28:19 -0700
On 9/13/03 11:03 PM, "Richard Rvnnbdck" <email@hidden> wrote:
>
I haven't had the need to use AppleScript's text item delimiter before and I
>
can't really get it to work, although I think it should
>
>
Here is the basic script:
>
>
set myFolder to quoted form of (POSIX path of "Macintosh
>
HD:Users:richardr:desktop")
>
set theFiles to (do shell script "find " & myFolder & " -name *.jpg")
>
>
>
>
Here is the script when I tried to change the item delimiter:
>
>
set myFolder to quoted form of (POSIX path of "Macintosh
>
HD:Users:richardr:desktop")
>
set myOldDelimiters to AppleScript's text item delimiters
>
set AppleScript's text item delimiters to "
>
"
>
set theFiles to (do shell script "find " & myFolder & " -name *.jpg") as
>
list
>
>
-- doesn't work, still returns a string so I can't do
>
item 1 of theFiles
>
>
set AppleScript's text item delimiters to myOldDelimiters
You need 'text items of theFiles', not 'as list':
set myFolder to quoted form of (POSIX path of (path to desktop as Unicode
text))
set myFolder to text 1 thru -3 of myFolder & "'" --drop final "/"
set theFiles to (do shell script "find " & myFolder & " -name *.jpg")
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}
set theFiles to text items of theFiles
set AppleScript's text item delimiters to oldDelimiters
theFiles
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.