PDA

View Full Version : AppleScript to pin PF desktop at login


cibi3d
Jul 01, 2009, 03:53 AM
Hi, I'm pretty new with PF and I'm delighted with it. One of the few things I've found a bit annoying is the fact that the Exposé Show Desktop function hides PF desktop too. Looking around I found a partial solution using Afloat (http://infinite-labs.net/afloat/). The problem is that Afloat forgets windows configurations when the application is closed, so each time I logged on I had to manually set PF desktop to be pinned to desktop.

For this task I wrote a script which I run at log on after PF. It has worked well for me:


tell application "Path Finder"
activate
set theWindows to every window whose (index = (number of windows) - 2)
repeat with wind in theWindows
set index of wind to 1
end repeat
tell application "Afloat Scripting" to set topmost window pinned to true
end tell


I'm not fluent in AS, so any suggestion is welcomed. Additionally, it has a contra: it works perfectly when PF has no open windows, but it is not guaranteed to if there is any other window. Does anyone know how to get the desktop window faithfully?

Thanks!