For some reason I'm unable to get or set the bounds of any of MacGPS
Pro's windows. I've even tried:
get bounds of the front window
Script editor says: "MacGPS Pro got an error: Can't get bounds of
window 1."
get bounds of every window
gives: "MacGPS Pro got an error: Can't get bounds of every window."
In your example below, what is "my missing window"? Is that the
title of the window or a reference to the window that I want to
manipulate?
tell application "MacGPS Pro"
activate
set bounds of window 1 to {100, 100, 500, 500}
end tell
This script returns "MacGPS Pro got an error: Some parameter wasn't
understood." I get the same error if I try "...the front window..."
Even though I think I've solved my problem (see previous message to
the list) I would still like to understand how to do this sort of
thing. Applescript just seems like a good thing to know.
-M@
On May 12, 2005, at 12:21 PM, David Wolfe wrote:
I frequently need to move windows from one display to another or to
set the window's size. I found the easiest way is to create a
window where I want it and size it appropriately. Then I GET the
window bounds from the application (or Finder). In the RESULTS
window, note the coordinates, then change the GET statement to SET
and put in the coordinates provided.
---
tell application "whatever"
activate
GET bounds of window "my dummy window"
end tell
---
reports {0, 44, 763, 277}
These coordinates work as if the multiple monitors are actually one
huge one. Then I simply change the script:
---
tell application "whatever"
activate
SET bounds of window "my missing window" {0, 44, 763, 277}
end tell
---
Running the script will then place the window at the same position
and size as the one you created to GET the bounds of.
David Wolfe
Hi, I am having a problem with an application and was wondering if
Applescript might be the way to solve this.
I have a Titanium Powerbook that I am trying to use for
displaying maps in my truck using a GPS. The application is MacGPS
Pro. It is a great application for displaying my current position
on USGS maps. I have a 7" Xenarc touchscreen mounted on the dash
and this is connected to the Powerbook via VGA. The problem is
that the USGS quads are contained in separate files, so as my
position moves the app has to open the new quad map. MacGPS Pro
opens up the new quad in a new window and, for some reason, it
chooses to place the window on the largest available screen. This
means that even though I'm viewing the map on the Xenarc, the new
map opens up on the Powerbook's screen. (I really don't want to be
dragging windows around and resizing them while I'm driving.) I
have confirmed this behavior with the author of the application and
he doesn't have a fix for it yet.
Is it possible to use Applescript to find the map window, move it
to the smaller of the two displays, and then make the window
fullscreen?
Since this machine's LCD was kindof messed up anyway I've removed
it from the machine completely in the hope that the Powerbook would
see the Xenarc as its only display. Unfortunately it still thinks
that it has its main display available. If there were some way to
convince the machine that it really doesn't have a main screen
anymore I think this problem would go away.
I'm open to any ideas or suggestions.
Thanks for your time,
-M@