Progressing well with my do-it-yourself Applescript course! This is so much fun!
i gave myself the following assignment:
I’m writing a script that grabs a list of url’s (one url per line) from a textedit document and then opens Safari, creates tab and opens the urls in these tabs.
--put the urls in a list: thelist
tell document 1 of application "TextEdit"
activate
copy every paragraph to thelist
end tell
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
repeat with myurl in thelist
--Dutch Safari: tabs are created perfectly! I love UIScripting!
click menu item "Nieuw tabblad" of menu "Archief" of menu bar 1
set mijnurl to contents of myurl as text
--the next line goes wrong because thelist also contains return characters
open location mijnurl
end repeat
end tell
end tell
Everything works very well, except for the Returns.
I could code some textmanipulation to strip the Returns out, but maybe there is a simpeler way, like “copy every paragraph to thelist without delimeters”
(obviously this doesn’t work, but maybe you have suggestions?)