Can someone one please help?
I used the following Script in Panther to add Local Cinema listing to my iPod but since I’ve upgraded to Tiger it’s not working properly.
Instead of a text file with the cinema listing I have a text file with “list” saved in it?
Here’s my script:
on run
set CinemaURL to "http://www.odeon.co.uk/pls/Odeon/odeon_text.film_list?P_CINEMA=Lincoln%20Wharf&P_REGION=3" -- Cinema URL
set MyCinema to "Lincoln Wharf" -- Cinema Name
(* Checks for iPods. This is from Apple's "Eject iPod Script" *)
set the mounted_iPods to my locate_iPods()
if the mounted_iPods is {} then
error "No iPod is connected to this computer."
else if the (count of the mounted_iPods) is greater than 1 then
-- choose iPod
set the ipod_names to {}
repeat with i from 1 to the count of the mounted_iPods
set this_iPod to item i of the mounted_iPods
tell application "Finder"
set the end of the ipod_names to the name of this_iPod
end tell
end repeat
set this_name to (choose from list ipod_names with prompt "Pick the iPod to use:") as string
if this_name is "false" then error number -128
repeat with i from 1 to the count of the ipod_names
if item i of the ipod_names is this_name then
set this_iPod to item i of the mounted_iPods
exit repeat
end if
end repeat
else
set this_iPod to item 1 of the mounted_iPods
end if
set Pod2GoFolder to "Pod2Go"
set MyLocation to this_iPod & "Notes:" & Pod2GoFolder & ":" as string
try
get MyLocation as alias
on error
tell application "Finder"
set MyLocation to this_iPod & ":Notes:"
end tell
end try
set theTargetFile to MyLocation & MyCinema as file specification
tell application "Safari"
activate
open location CinemaURL
end tell
tell application "System Events"
if UI elements enabled then
delay 5
keystroke "a" using command down
delay 0.5
keystroke "c" using command down
end if
end tell
delay 1 --> Seems to help
(* Define the file contents and write the file *)
tell me
activate
set theFileContents to the clipboard
end tell
try
open for access theTargetFile with write permission
set eof of theTargetFile to 0
write (theFileContents) to theTargetFile starting at eof with replacing
close access theTargetFile
on error
try
close access theTargetFile
end try
end try
tell application "Safari"
quit
end tell
end if
end run
(* Checks for iPods. This is from Apple's "Eject iPod Script" *)
on locate_iPods()
set the volumes_directory to "/Volumes/" as POSIX file as alias
set the volume_names to list folder volumes_directory without invisibles
set mounted_iPods to {}
repeat with i from 1 to the count of volume_names
try
set this_name to item i of volume_names
set this_disk to ("/Volumes/" & this_name & "/") as POSIX file as alias
set these_items to list folder this_disk
if "iPod_Control" is in these_items then
set the end of the mounted_iPods to this_disk
end if
end try
end repeat
return mounted_iPods
end locate_iPods
Thanks for looking.