Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Creating a sliding browser window in Firefox Web Browsers
I like the sliding window of DeskBrowse a lot, but the rest of the browser is pretty broken, so I went looking for a way to implement the slide on Firefox, my browser of choice.

A previous hint covered an AppleScript that does this in Safari --unfortunately I am hooked on Firefox, and the script won't work with it. (As noted in the comments, Firefox AppleScript support isn't that great.) But after some trial and error, I was able to write something that seems to work well for Firefox, despite being a bit of a kludge.

Copy and paste the script into Script Editor, and edit it to reflect your screen size and homepage. Then save it as a .scpt file, run it with a hot key, and get a nice sliding window in Firefox!

[robg adds: I have mirrored the script here on hints. I tested this, and it works well (at least for one window).]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[8,875 views]  

Creating a sliding browser window in Firefox | 10 comments | Create New Account
Click here to return to the 'Creating a sliding browser window in Firefox' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Creating a sliding browser window in Firefox
Authored by: 31d1 on Jul 11, '06 08:00:14AM

A couple comments:
1) You no longer need to set screen size.
2) Attempts to get it to work with multiple windows didn't work out very well. The problem is this script is kind of delicate - something I found out yesterday is that firefox has a "hidden window" that is used for various things - and when I try to do anything fancy (it seems like) the script ends up controlling the hidden window and you have to restart firefox to get things back to normal. What I have here works well and considering the poor applescript support I'm surprised I got even this far.
3) This script also doesn't play well if you call it when the window is minimized to the dock. Same deal - it tends to create(?) a weird unclosable window.
4) It _does_ work well with virtual desktops ( I use virtue ). If you are runing virtue clicking on most apps in the dock will take you to the desktop it's on, but firefox doesn't do that. This script will however, slide the window in on any desktop - though if you switch to a new desktop while the browser is open you need to hit the hotkey twice - once to slide it out of the old desktop, once to slide it in to the new one.

My hope is some whizzbang scripters here can make this a bit more robust, but be aware of that hidden window thingy...



[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: smoohova on Jul 11, '06 10:44:56AM

Can anyone make a script working with camino?



[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: 31d1 on Jul 11, '06 11:27:58AM
The script mentioned here should work for camino: http://www.macworld.com/weblogs/macosxhints/2006/03/safarislider/index.php

[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: smoohova on Jul 11, '06 02:18:33PM

It doesn't exactly work. I get the following error at the line that says:

set {bds1, bds2, bds3, bds4} to bounds of window docName
end tell

Camino got an error: NSReceiverEvaluationScriptError: 4



[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: 31d1 on Jul 11, '06 03:32:36PM
Ok, here's a version of my script that works for Camino.

http://code.cutup.org/applescript/cctl.applescript

I was getting the same error until I changed application process names from lowercase camino to uppercase Camino. The only other thing I had to change was firefox uses openURL and camino uses open url.

It might be worth checking if that was the problem in the other script, as it is more robust.

[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: smoohova on Jul 11, '06 07:44:00PM

Thanks 31d1, works like a charm so far



[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: stephenpen543 on Jul 12, '06 05:49:53AM

When I run the script, it says there is an " NSInternalScriptError", and it highlights:
"set position of window 1 of application process "firefox-bin" to {x, 23}"
Any idea why?

---
I ain't what I should be
I ain't what I will be
But I ain't what I was



[ Reply to This | # ]
No seamless operation of scripts?
Authored by: rampancy on Jul 13, '06 12:14:49AM

I've tried toying with the Safari script cited in the Macworld article, as well as the Firefox script cited above, and the Camino script mentioned in the other comments - all they seem to do is launch Script Editor, and then they only work when I click "Run".

I've tried saving the scripts as .app files, and while they do work, for some odd reason the window sliding slows to a crawl when I run them.

Am I missing something here?



[ Reply to This | # ]
AppleScript Error for me
Authored by: gnaihc on Jul 16, '06 02:53:06AM
I got this when running the script

System Event got an error:
NSReceiverEvaluationScriptError: 4
on this line

set position of window 1 of application process "firefox-bin" to {x, 23}
Any help or ideas?

[ Reply to This | # ]
Creating a sliding browser window in Firefox
Authored by: Anonymous on Jul 20, '06 02:14:21PM

Thanks 31d1 for the slick script. It worked fine for me for abt a week. i had a trigger in quicksilver setup to activate the script and worked like magic.

But as of today I get the same error as stephenpen543 and gnaihc ...

The Event Log in the Script Editor shows:
----------
get visible of application process "firefox-bin"
true
set position of window 1 of application process "firefox-bin" to {0, 23}
"System Events got an error: NSReceiverEvaluationScriptError: 4"

------------

what did I break? I haven't done any upgrades etc. to firefox or the OS.

BTW, If Firefox is not open at all then the script manages to open up firefox.




[ Reply to This | # ]