Update to the recent post: URL Access Scripting very strange error or is it mine...
Update to the recent post: URL Access Scripting very strange error or is it mine...
- Subject: Update to the recent post: URL Access Scripting very strange error or is it mine...
- From: Paulo Jorge Rodrigues Góis <email@hidden>
- Date: Fri, 01 Mar 2002 15:33:27 +0000
Ok, its working, you can try it if you please...
But it has a strange error... It does not get the refreshed page if
Internet
Explorer is not open and locking at the same page.
If IE is closed the script just gets always the same info.
When IE is open but not pointed to that specific page the script doesn't get
the updated page it only works fine when IE is open and pointed to that
page.
How can I solve this? I really think this is strange, My question is what is
the
--
property required_version : "2.0.3"
try
tell application "iTunes"
-- VERSION CHECK
set this_version to version as string
if this_version is not greater than or equal to required_version then
beep
display dialog "This script requires iTunes version: " &
required_version & ,
return & return & ,
"Current version of iTunes: " & this_version buttons
{"Update",
"Cancel"} default button 2 with icon 2
if the button returned of result is "Update" then
my access_website("
http://www.apple.com/itunes/download/")
return "incorrect version"
end if
end if
-- get the title of the web page
set item_name to "playwindow2.php"
set recieving_filename to "wolf-fm.htm"
set parent_directory to "
http://apps.wolffm.com/"
set this_webpage to (parent_directory & item_name)
set local_filepath to ((path to temporary items folder as text) &
recieving_filename)
set timeout_amount to 60
with timeout of timeout_amount seconds
tell application "URL Access Scripting"
download this_webpage to file local_filepath replacing yes
with
progress
end tell
end timeout
tell application "URL Access Scripting" to quit
set html_text to (read file local_filepath)
set title_start to offset of ">title< in html_text
set title_end to offset of ">/title< in html_text
set the_title to characters from (title_start + 7) to (title_end - 1)
of
html_text as string
set song_info to characters 10 thru end of the_title as text
set string_location to offset of "-" in song_info
set song_artist to (characters 1 thru (string_location - 2) of
song_info) as text
set song_title to (characters from (string_location + 2) to end of
song_info) as text
-- set the id3 of the Wolf-FM streming to IE window information
tell source "library"
tell playlist "My Radios"
try
set the name of (every track whose comment is "The Hottest
mix of the '70s, '80s and today") to "Wolf-fm now plaiyng: " & song_title
set the artist of (every track whose comment is "The
Hottest
mix of the '70s, '80s and today") to song_artist
on error
display dialog "The Wolf-FM radio station was not found."
buttons {"Cancel"} default button 1
end try
end tell
end tell
end tell
tell application "iTunes" to activate
on error error_message number error_number
if the error_number is not -128 then
tell application "iTunes"
activate
beep
display dialog ("Error number: " & (error_number as text) & ,
return & return & ,
error_message) buttons {"Cancel"} default button 1 giving up
after 15
end tell
end if
end try
on access_website(this_URL)
ignoring application responses
tell application "Finder"
open location this_URL
end tell
end ignoring
end access_website
--
Paulo Jorge Rodrigues Gsis
R. Antsnio A. Machado n: 24, 5: Fte.
1600-013 Lisboa Portugal
e-mail: email@hidden
e-mail: email@hidden
e-mail: email@hidden
Telefone rede fixa: 351217263568
Telefone msvel: 351965450207
_______________________________________________
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.