![]() | All Advertisers |
| Member Services Directory | Classifieds | Reviews | Jobs | Deal Zone | Merchandise | Marketplace | Facebook App | Books, DVDs & Gadgets | Video Vault | Tips & Techniques |
| |||||||
New Reply | Thread Tools | Search this Thread |
| | #1 |
| Mindreader | Gearslutz Safari Applescript wot i wrote
OK I give in here's the code in all its glory (not) For those of you not familiar with applescript, you open up the included software called 'Script Editor', put this code inside it by copy/paste, then press 'Save As' and then shoose 'Save As Application' or 'Run Only' It will create a little app that executes this script. Let me know if it works. ** ONLY WORKS IN OSX RUNNING NEW VERSION OF SAFARI Oh, what does it do: It opens up the main gearslutz categories in new tabs in safari _________________________ property timeout_value : 60 tell application "Safari" activate try if not (exists document 1) then make new document at the beginning of documents end if set the URL of the front document to "http://www.gearslutz.com" delay 2 if my page_loaded(timeout_value) is false then error "The page did not load in the indicated timeout value." set the links_count to (do JavaScript "document.links.length" in document 1) as integer set the links_list to {} if the links_count is not 0 then repeat with i from 0 to (the links_count - 1) set this_link to (do JavaScript ("document.links[" & (i as string) & "].href") in document 1) if this_link contains "forumdisplay" and this_link is not in the links_list and this_link does not contain "16" and this_link does not contain "7" and this_link does not contain "8" and this_link does not contain "20" then set the end of the links_list to this_link end if end repeat end if close document 1 make new document at the beginning of documents repeat with i from 1 to the number of items in links_list set this_item to item i of links_list if i is 1 then set the URL of the front document to "http://www.gearslutz.com/board/" & this_item else set this_URL to "http://www.gearslutz.com/board/" & this_item my new_tab() set the URL of document 1 to this_URL end if end repeat on error the error_message number the error_number if the error_number is not -128 then set the error_text to "Error: " & the error_number & ". " & the error_message display dialog the error_text buttons {"Cancel"} default button 1 end if end try end tell on page_loaded(timeout_value) repeat with i from 1 to the timeout_value tell application "Safari" if (do JavaScript "document.readyState" in document 1) is "complete" then return true else if i is the timeout_value then return false else delay 1 end if end tell end repeat return false end page_loaded 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 |
| | |
| | #2 |
| Lives for gear Joined: Nov 2002 Location: Seattle
Posts: 2,267
|
Nice one, Bev! thumbsup |
| | |
| | #3 |
| Lives for gear Joined: Jun 2002 Location: Maryland,USA
Posts: 3,538
|
Not working for me.
|
| | |
| | #4 |
| Mindreader |
You must have the newest version of Safari which suports tabbed browsing
|
| | |
| | #5 |
| Lives for gear Joined: Nov 2002 Location: Seattle
Posts: 2,267
|
Hmmm...I should clarify my post. When I wrote "Nice one, Bev!", I meant cool idea. This was before trying to run it. No joy here either.... I have Safari 1.0 Beta 2 (v73) and use tabs all the time, so that's not the issue. The script is not able to be opened in the AppleScript editor as it's read-only. Any thoughts, Bev? |
| | |
| | #6 |
| Mindreader |
bizarre Mine works fine I've been using it all day and it's rather a cool thing. I'll fix it later. I'm off to see Beck now at the Albert Hall. |
| | |
| | #7 |
| Mindreader |
Ok it works now I had accidentally posted up the 'work in progress' script instead of the real one. Duh. Beck was good by the way. I didn't realise he was that good on harmonica! |
| | |
| | #8 |
| Lives for gear Joined: Nov 2002 Location: Seattle
Posts: 2,267
|
Ummm...nope, no dice. Is it at the same link as before? Should I just be double-clicking the script and expecting it to open Safari? Were the Flaming Lips backing Beck? I'd love to see that show!! |
| | |
| | #9 |
| Mindreader |
It was my frikkin iDisk screwing the file up. It works fine when i drag it out of my idisk, but it does some kind of its own wierd compression on it when you download it from the web page. So I stuffed it myself and stuck it up. Now try. Oh and it was Beck doing an acoustic set. He twiddled around on piano and a bit of rhodes, made some strange noises with a drum machine, and played a wierd wind organ thing. And sang Loser. |
| | |
| | #10 |
| Mindreader |
Man it STILL doesn't work. iDisk is losing resource fork of the frikkin file and giving it the wrong attributes making it look like its an editable script. Piece of s*** iDisk grr, etc |
| | |
| | #11 |
| Lives for gear Joined: Jun 2002 Location: Maryland,USA
Posts: 3,538
|
I get this when I run it.
|
| | |
| | #12 |
| Lives for gear Joined: Nov 2002 Location: Seattle
Posts: 2,267
|
I'm getting the same error. Bev, email it to me (raw script, no Stuffit) and I'll put it up on my server with a link here so people can grab it. |
| | |
| | #13 |
| Mindreader |
I just emailed it myself and it worked fine For some reason as soon as it's stuffed it loses its mind. I'll email it to you then. |
| | |
| | #14 | |
| Lives for gear | Quote:
![]() sorry, still in a psw kind of mood. | |
| | |
| | #15 |
| Lives for gear Joined: Nov 2002 Location: Seattle
Posts: 2,267
|
Alright, Bev, should we try this again??! Email it to me one mo' time and see if we can get this thing to fly! |
| | |
New Reply
Facebook
Twitter
LinkedIn
| Thread Tools | Search this Thread |
| Similar Threads | ||||
| Thread | Thread starter | Forum | Replies | Last Post |
| Anyone good with applescript? Or help. | Chippy569 | Music computers | 6 | 9th May 2011 02:43 AM |
| Wot y'all using for SFX database? | jahtao | Post Production forum! | 37 | 18th January 2010 12:33 PM |
| Wot? tags not working? | Blast9 | So much gear, so little time! | 1 | 27th March 2007 01:12 PM |
| BSS gear: wot the...? | Bob the V | High end | 6 | 16th August 2006 07:54 PM |
| Wots the best way to transfer Nuendo to PT HD? | shipshape | High end | 6 | 7th May 2005 12:48 AM |
| |