Hi,
I "switched" some time ago and I am very happy except for one thing that drives me up the wall: there seems to be no way to tell an application to maximize in the Windows way, i.e. take up the whole screen.
This is the worst in Preview.app. When I click the (+) button with a PDF open and partially visible (i.e. there are horizontal scroll bars), for example, it resizes the window to a different size where the PDF is still only partially visible, although if it resized a bit wider I could see the whole width of the document. I can't make heads or tails of how it's deciding how much to resize but it is never what I want. The result is that I never use the (+) button and constantly have to resize the window manually -- annoying!
I think there must be either a preference to change the behavior of (+) to truly maximize, or otherwise perhaps a snippet of Applescript that did something like "Tell application foo to change window size to (desktop width) x (desktop height)" -- can anyone help?
Thanks!
mark hunte
03-13-2006, 12:16 PM
you should do a search on the Main site, I am sure hints using applescript have been published there.
http://www.macosxhints.com
The plot thickens. As you suggested I searched the main site and found something I was able to adapt for some applications. For example, this snippet works:
tell application "Safari"
tell front window
set bounds to {0, 0, 1023, 767}
end tell
end tell
But this does not:
tell application "Preview"
tell front window
set bounds to {0, 0, 1023, 767}
end tell
end tell
And Preview.app is where I really want this functionality. Does anyone have any suggestions?
mark hunte
03-15-2006, 03:39 PM
I don't thing preview is scriptable.
Which is just plain stupid... since its an apples app.
tbsingleton73
03-15-2006, 04:32 PM
...When I click the (+) button with a PDF open and partially visible...
Note the (+) is a zoom button, not a maximize button, like windows.
Try configuring Preview to set default image size as Actual Size.
If the image is large then clicking the (+) button should zoom Preview to as big as the image.
Also try this with "Respect image DPI for 'Actual Size' " checked and un-checked.
I do agree a "maximize" feature would be great.
mark hunte
03-23-2006, 07:27 PM
The plot thickens. As you suggested I searched the main site and found something I was able to adapt for some applications. For example, this snippet works:
tell application "Safari"
tell front window
set bounds to {0, 0, 1023, 767}
end tell
end tell
But this does not:
tell application "Preview"
tell front window
set bounds to {0, 0, 1023, 767}
end tell
end tell
And Preview.app is where I really want this functionality. Does anyone have any suggestions?
I don't thing preview is scriptable.
Which is just plain stupid... since its an apples app.
em.. while looking at the apple site, Cocoa Scripting Guide (http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001982-BCICHGIE)
I came across the part of how to add scriptability to an existing app.
Now this is intended for developers to be able to add Applescript scriptability and definitions to their own apps.
But what I realised was that there is a standard suite.
And all you need to do to get it is add
<key>NSAppleScriptEnabled</key>
<string>YES</string>
to the apps. info.plist file
So in Preview.app
You can crtl click on the app. and 'Show Package Contents" go to
Preview.app->Contents->Info.plist
open the Info.plist in a text editor.
and add the CODE like this.
<key>CFBundleVersion</key>
<string>398</string>
<key>LSHasLocalizedDisplayName</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>10.4.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>PVApplication</string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
</dict>
</plist>
Its the last <key> and <string> at the bottom of the plist.
Close and save.
Now the script.
tell application "Preview"
tell front window
set bounds to {0, 0, 1023, 767}
end tell
end tell
Will work.
Before doing this Make sure you back up the app you are playing with.
I did this with a copy of the App out side of the Applications folder.
You can also call up a basic .sdef library up in Script Editor.
And use some of the command.
Not all will work, but I would think it should not be that hard for some one with the know how to add their own Defs. to the basic one.
Also remember Update most likely will break this.