Netscape email scripting & pasting weirdness
Netscape email scripting & pasting weirdness
- Subject: Netscape email scripting & pasting weirdness
- From: Kelvin Aitken <email@hidden>
- Date: Wed, 20 Aug 2003 12:30:30 +1000
- Organization: Kelvin Aitken Photography
Talking of copying and pasting, when I copy a portion of text from an
email such as this:
B07D_17147.jpg
B07D_17106.jpg
B07A01_32372.jpg
ENV_49515.jpg
F18AO11_23209.jpg
T01A02_6628.jpg
T01A02_50739.jpg
and save with TextEdit I then run the following script:
set fileTarget to (choose file with prompt "Select the file to replace
text in") as text
set messageText to read file fileTarget
set AppleScript's text item delimiters to "
" --looking for returns to divide the text up into a list
set outList to text items of messageText as list
I get a nice neat list like this: {"B07D_17147.jpg", "B07D_17106.jpg",
"B07A01_32372.jpg", "ENV_49515.jpg", "F18AO11_23209.jpg",
"T01A02_6628.jpg", "T01A02_50739.jpg"}
which is a list with seven items.
However if I were to manually type out the file names with a return
between each so that the TextEdit file looks identical and then run the
script I get this:
{"B07D_17147.jpg
B07D_17106.jpg
B07A01_32372.jpg
ENV_49515.jpg
F18AO11_23209.jpg
T01A02_6628.jpg
T01A02_50739.jpg"}
which is a list with just one item.
What obvious mistake do I have in the script?
Kelvin.
Nigel Smith wrote
In the meantime, how about going through the clipboard? Select the text,
Command-C, run the script would might be something like:
tell application "AppleWorks 6"
set theDoc to make new document at front
set contents of theDoc to the clipboard
end tell
HTH,
Nigel
_______________________________________________
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.