Results 1 to 3 of 3
  1. #1

    Member Since
    Jul 16, 2007
    Launching an applescript FROM firefox (URL bar?)
    Basically, here's what I'm trying to do:

    I often have a small chat program running, I keep it in the bottom right corner of my screen. It's kind of a stupid application, so it never pops up above active windows for an update, so I keep it uncovered - this means all my windows have to be shrunk to fit, and to not hide it.

    Now, because I'm such an OCD person, I like to have a perfect, 1px border between applications, and I like things to be neat and orderly, etc. That means there's a VERY specific place all my firefox windows go. When i open a new one, however, they can be in any shape, size, etc. For a while, I had a bookmarklet with a keyword, I would just type "chatsize" into the URL bar, and the window would automatically position itself correctly. The problem with this is the fact that it, for some reason, would ignore the 4 leftmost pixels of the entire screen, and would not line up with the edge. Moving it 4 pixels isn't such a big deal, but it gets kind of annoying. No matter what I tried javascripting into the URL bar, it never worked.

    I came up with a solution: Applescript, I could make the window go to the perfect spot and be the perfect size, but now, I have another problem: I can't launch the applescript from the URL bar. I want to be able to type in "chatsize" to the URL bar, and have it work perfectly, but whenever I change the bookmark to the applescript's location on my hard drive, it attempts to download it. Does anybody have any clue how to launch the application from the URL bar?

  2. #2

    Member Since
    May 30, 2011
    Applescript to move Firefox windows
    I've been using Applescript recently to do simple task scripts lately, including parsing Firefox content. One of the things that bugs me about Firefox is that opening a new window always occurs just below the old one, so a lot of my windows are 20-30 pixels lower than I want, hiding the link/status bar at the bottom. So I too wanted to be able to shuffle windows around, but Firefox hasn't been working so well...

    The change position part of the script seems to take 20-30 seconds to run at the top of my other scripts, or actually closes the window when placed at the end of my script. I reduced the active code to show below. Could I get a snippet of what you have that's working? I assume you're getting realistic response time, too... (I haven't gotten as far as showing scripts in Firefox yet, so can't help you there, sorry.)

    tell application "Firefox" to activate
    tell application "System Events"
    tell process "Firefox"
    tell window 1
    set xy to position
    if item 2 of position > 22 then
    set position to {item 1 of xy, 22}
    end if
    #set size to {1070, 800}
    end tell
    end tell
    end tell


  3. #3

    McYukon's Avatar
    Member Since
    May 14, 2009
    Near Whitehorse, Yukon
    2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
    The problem with this is the fact that it, for some reason, would ignore the 4 leftmost pixels of the entire screen,
    I bet thats because your dock is hidden over on that side of the screen.
    The dock has a invisible 4 pixel top that will keep windows from resizing themselves over it, even if you use the window resize corner you will not be able to get over that.
    You can get over it by pushing the window to the left and then resizing it again, (What you are doing)

    I have the same thing here too, but since my dock is at the bottom of the screen I don't notice it as much as when it is on the sides.

    As for launching the applescript from Firefox, I can't see any way that would work as Firefox always tried to download the applescript with the different things I tried.
    Use the reputation system if a post helps you!
    Mac Forums IRC Channel - Help build it by hanging out with us
    The next sentence is true. The previous sentence is false.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. url bar disappeared
    By garden_fiend in forum Internet, Networking, and Wireless
    Replies: 2
    Last Post: 01-29-2012, 08:57 AM
  2. Launching an application while executing an applescript?
    By Commander_FarkU in forum macOS - Development and Darwin
    Replies: 0
    Last Post: 06-13-2010, 09:32 PM
  3. Launching applescript from bash
    By samimk120 in forum macOS - Development and Darwin
    Replies: 1
    Last Post: 09-08-2008, 12:35 AM
  4. Launching .url in Firefox on Leopard
    By drusse11 in forum macOS - Operating System
    Replies: 1
    Last Post: 08-18-2008, 07:17 AM
  5. Use Safari URL bar as a search bar
    By lukenn77 in forum macOS - Apps and Games
    Replies: 9
    Last Post: 06-28-2008, 06:26 AM

Posting Permissions

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