Re: Finder Scripting
Re: Finder Scripting
- Subject: Re: Finder Scripting
- From: Emile Schwarz <email@hidden>
- Date: Tue, 23 Aug 2005 10:16:24 +0200
Hi Dave, all,
thank you for sharing the Radar work-around.
The position bug is still there and the 'work-around' does things worst than
they were before. Probably my fault, I applied the work-around on the first
script that was on hand and it was setting the window position, not the window
bounds. See Example script #1.
Nota: I use both, the choice is context depending.
Then it appears to my early morning tired eyes that I can try after setting the
window bounds and I do that. See Example script #2.
IT WORKS ! Fine ! Thanks !
Example script #1 [WINDOW POSITION]
tell application "Finder"
-- Set the front window position
set position of front window to {0, 44} -- top/left position
-- DL work-around from Radar
set toolbar visible of front window to true
set toolbar visible of front window to false
end tell
Example script #2 [WINDOW BOUNDS]
tell application "Finder"
-- Set the front window bounds
set bounds of front window to {0, 44, 549, 441}
-- DL work-around from Radar
set toolbar visible of front window to true
set toolbar visible of front window to false
end tell
So, and while the bug would be squashed, I have a workaround for these two troubles:
a. the position case: I use the Example script #3 []
b. the bounds case: I use the Example script #2 []
Example script #3 [WINDOW POSITION, THEN WINDOW BOUNDS]
tell application "Finder"
-- keyboard energy saver
set fw to front window
-- set the front window position
set position of fw to {0, 44} -- top/left position
-- get the actual bounds (for width, height)
set boundsOfFW to bounds of fw
-- Set the front window bounds
set bounds of fw to boundsOfFW
-- Apply the bug work-around
set toolbar visible of front window to true
set toolbar visible of front window to false
end tell
Thank you to all involved people for this work-around.
Greetings from Béziers, France,
Emile
PS: I do not want to be pessimist, but... there is another bug, this time when
the Toolbar is visible.
the code to display it is:
tell application "Finder"
set position of front window to {0, 44}
end tell
In the Finder, click in the Toolbar button to make the Toolbar visible on a
window where its position is not {0,44} of course, run the script, close the
window, open it back: the Toolbar is invisible and the window opens at a
different location than {0,44} or its previous location.
OK: I NEVER use to set Toolbar to visible, so I do not care (sorry guys) about
this part of the bug. ;)
Yes, I am happy to get a work-around for the two bugs I have since the end of
April 2005. ^_^
email@hidden wrote:
From: Dave Lyons <email@hidden>
Subject: Re: Finder Scripting
To: email@hidden
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
On Aug 21, 2005, at 12:01 AM, Emile Schwarz wrote:
Hi Dave et al.,
I am sorry to have to report the following:
tell application "Finder"
set bounds of front window to {0, 44, 100, 100}
return properties of front window
end tell
When run, the script does its job. BUT, close the window, open it
and you get the window back to the previous location and widh/
height...
This appears in the original 10.4, 10.4.1, 10.4.2.
Thanks; we are now tracking this better in Radar.
I haven't yet tried the following workaround (offered in one of the
bug reports), which is said to make the change stick. After setting
the bounds, change the "toolbar visible" property and then change it
back:
set toolbar visible of theWindow to true
set toolbar visible of theWindow to false
-- or false, true
(It won't be pretty to watch it run, but for some purposes it's
better than nothing.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden