Re: Photo List - again
Re: Photo List - again
- Subject: Re: Photo List - again
- From: "AppleScripter" <email@hidden>
- Date: Thu, 6 Sep 2001 09:52:26 -0500
>
This is an example of what I have:
>
>
Background Sky 00659.jpg
>
Sunset 00660.jpg
>
Clouds 00664.jpg
>
Sunshine 00665.jpg
>
>
This is an example of what I need:
>
>
00659.jpg Background Sky
>
00660.jpg Sunset
>
00664.jpg Clouds
>
00665.jpg Sunshine
>
This is completely untested since I am on a PC at work.
set inputFile to (choose file) --this would be the file containing the above
info
set outList to {} --to be used in a minute
set itemList to read file inputFile using delimiters return --this will give
you a list of items that are each line of the file
set {oldTIDs, text item delimiters} to {text item delimiters, " "} --TID
police
repeat with i in itemList
set theNames to text items of i --splits your line into two items
set outItem to (item 2 & " " & item 1) as text --transposes them
copy outItem to the end of outList --puts them in a new list
end
open for access file "outFile" with write permission
write outList to file "outFile" to eof
cose access file "outFile"
set text item delimiters to oldTIDs --TID police
HTH,
Greg Strange