• Lucid Dreaming - Dream Views




    Results 1 to 10 of 10
    1. #1
      .. / .- –– / .- .-. guitarboy's Avatar
      Join Date
      Sep 2008
      LD Count
      Over 9000
      Gender
      Location
      Homeward Bound
      Posts
      1,571
      Likes
      49

      ... Applescript question

      Yahh I know.
      I'm too lazy to go past the first page of google for this.
      How would I go about opening firefox and the having it opening a webpage?

      tell application "Firefox" to activate
      then what?


      Feel free to ask any other applescript questions here, it's something I like to use because unlike C, HTML, actionscript etc, I don't have to do too much remembering or refer to my plethora of text files containing MBs of code.

    2. #2
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      know nothing about applescripts,
      but Firefox (at least on Linux) allows you to specify arguments for initial tabs

      Code:
      firefox http://www.google.com http://www.yahoo.com
      will launch firefox with 2 tabs, google & yahoo
      (\_ _/)
      (='.'=)
      (")_(")

    3. #3
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Firefox is terrible on the Mac, it supports very little script. I don't know why, but it's part of the reason that Mac users tend not to use it.

      You have to fake being a user.
      Code:
      tell application "Firefox" to activate
      tell application "System Events"
         keystroke "l" using {command down} -- Go to the address bar
         keystroke "http://www.dreamviews.com/" & return -- Simulate user putting in an address and hitting enter
      end tell
      Last edited by ninja9578; 12-08-2009 at 02:27 PM.

    4. #4
      .. / .- –– / .- .-. guitarboy's Avatar
      Join Date
      Sep 2008
      LD Count
      Over 9000
      Gender
      Location
      Homeward Bound
      Posts
      1,571
      Likes
      49
      Just in case, what would be the difference for Safari?
      Also, is this the simplest way to do this? (besides putting the ends at the very end)
      Code:
      tell application "iTunes"
      	play track 999 of library playlist 1
      end tell
      delay 250.8
      tell application "iTunes"
      	play (track 1000 of library playlist 1)
      end tell
      delay 213.6
      tell application "iTunes"
      	play track 1001 of library playlist 1
      end tell
      delay 262.2
      tell application "iTunes"
      	play track "Bloodmeat" of library playlist 1
      end tell

    5. #5
      .. / .- –– / .- .-. guitarboy's Avatar
      Join Date
      Sep 2008
      LD Count
      Over 9000
      Gender
      Location
      Homeward Bound
      Posts
      1,571
      Likes
      49
      Alright, how's this?
      Code:
      tell application "Firefox" to activate
      tell application "System Events"
          keystroke "l" using {command down} -- Go to the address bar
          keystroke "www.dreamviews.com/community" & return
          -- Simulate user putting in an address and hitting enter
          delay 3
          keystroke "t" using {command down}
          keystroke "http://facebook.com" & return
      end tell
      
      tell application "iTunes"
          play track 864 of library playlist 1
      end tell
      Last edited by guitarboy; 12-09-2009 at 12:29 AM.

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      You know, you can tell iTunes to play a specific track instead of a number

      No, Safari is much better than Firefox, it was written by Apple, so it's very scriptable.

    7. #7
      .. / .- –– / .- .-. guitarboy's Avatar
      Join Date
      Sep 2008
      LD Count
      Over 9000
      Gender
      Location
      Homeward Bound
      Posts
      1,571
      Likes
      49
      Quote Originally Posted by ninja9578 View Post
      You know, you can tell iTunes to play a specific track instead of a number

      No, Safari is much better than Firefox, it was written by Apple, so it's very scriptable.
      Those titles are too long part of a symphony and I am too lazy to copy it down exactly.

    8. #8
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      But if your playlist changes, then the number changes.

      The problem with system events is, if the user clicks on something else, the events go to something else. I don't do much AppleScript, but delay is in seconds if I remember correctly. People don't have patience, when I open something, I usually click away to something else very quickly, specifically iChat.

    9. #9
      .. / .- –– / .- .-. guitarboy's Avatar
      Join Date
      Sep 2008
      LD Count
      Over 9000
      Gender
      Location
      Homeward Bound
      Posts
      1,571
      Likes
      49
      Quote Originally Posted by ninja9578 View Post
      But if your playlist changes, then the number changes.

      The problem with system events is, if the user clicks on something else, the events go to something else. I don't do much AppleScript, but delay is in seconds if I remember correctly. People don't have patience, when I open something, I usually click away to something else very quickly, specifically iChat.
      Yah, the delay is the seconds in the song because it would skip to the last one with out it.
      Safari is really slow with youtube and it has no addons I'm terrible at C and html and java are boring, actionscript is for flash. That's all I know .

    10. #10
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Youtube is flash, it has nothing to do with Safari. Safari uses the same plugin as Firefox.

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •