Seriously, cant get it to work. Tried a bunch of things and its not working for me. The first half basically digs thru the XML and finds my text (variables). The 2nd half opens URLs in tabs in one window. They each work great when alone, but together… no good. The problem is within that fix URL, the variable isn’t defined. I tried making the myVar a clipboard within the link, but thats not really the route i want to go, as it will screw me up later.
any help is of course more than appreciated!
thanks,
e @ apple
tell application "Safari"
set allXML to source of front document
set the clipboard to allXML
end tell
setTID("Playlist Title")
set albumTitle to (text item 2 of allXML) as string
setTID("\"PageWrapper")
set albumTitle to (text item 1 of albumTitle) as string
setTID1("value=\"")
set albumTitle2 to (text item 2 of albumTitle) as string
setTID1("\" name=")
set albumTitle2 to (text item 1 of albumTitle2) as string
to setTID(newTID)
set AppleScript's text item delimiters to {newTID}
end setTID
to setTID1(newTID)
set AppleScript's text item delimiters to {newTID}
end setTID1
--set the clipboard to albumTitle2
set myVar to text of albumTitle2
property URL1 : "http://www.cduniverse.com/sresult.asp?HT_Search=ARTIST&HT_Search_Info=" & myVar & "&image.x=0&image.y=0&cart=666422262&style=music&altsearch=yes\n"
property URL2 : "http://www.amazon.com/"
property URL3 : "http://www.google.com/"
property URL4 : "http://www.tower.com/"
tell application "Safari"
activate
my new_tab()
open location URL1
my new_tab()
set the URL of document 1 to URL2
my new_tab()
set the URL of document 1 to URL3
my new_tab()
set the URL of document 1 to URL4
end tell
on new_tab()
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Tab" of menu "File" of menu bar 1
end tell
end tell
end new_tab