New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Ľ Advice and insight from world-class Apple enthusiasts Ľ Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Launching an applescript FROM firefox (URL bar?)

Post Reply New Thread Subscribe

Thread Tools

Member Since: Jul 16, 2007
Posts: 23
Snipeye is on a distinguished road

Snipeye is offline
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?
QUOTE Thanks

Member Since: May 30, 2011
Posts: 1
dwilson is on a distinguished road

dwilson is offline
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

QUOTE Thanks

McYukon's Avatar
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe

« Flash player | Facetime: multiple Accounts on one Mac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
Applescript - Firefox Floris OS X - Development and Darwin 6 05-08-2009 10:50 AM
Launching applescript from bash samimk120 OS X - Development and Darwin 1 09-08-2008 12:35 AM
Applescript for Toggling Energy Saver Presets Unifier OS X - Operating System 1 03-17-2008 08:58 PM
Firefox, Passwords & an AppleScript Brown Study OS X - Apps and Games 0 03-03-2007 12:22 AM
[ANN] New comprehensive AppleScript book hanaan OS X - Development and Darwin 0 11-06-2004 07:28 PM

All times are GMT -4. The time now is 08:34 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?