0

I have an AppleScript which allows me to maximize a window (not fullscreen just maximize (keep top bar & task bar)). For some reason certain applications ignore the request and just stay the same size (Adobe products consistently ignore it). You can read the script here, I got this from somewhere else (a stackoverflow post). Why might the script not work for certain windows and how could I possibly fix it?

  • 1
    Can you link to the original stackoverflow post? There may be some clues there. – Monomeeth Apr 14 '17 at 1:22
  • What apps are you having trouble with, and which windows in each app? I gather it's not as simple as being unable to size a window that can't be sized by the mouse, such as the About Safari window. Originally scriptability was optional for Mac app developers, and so would cost more. As a sometime developer I can easily imagine how scriptability might not be the first priority of a product team. – D A Vincent Apr 14 '17 at 8:01
  • 1
    @DAVincent One of the most common program's I have trouble with is photoshop, just the general window. I can maximize it with the button but not script. – van dench Apr 14 '17 at 14:05
  • 1
    @Monomeeth I don't know exactly where I got the code from, but here is a page which has the same code. – van dench Apr 14 '17 at 14:07
1

Since you've referenced Adobe products (and Photoshop specifically) in your question/comments, I'll refer to those here.

There is really nothing inherently wrong with the script - it's just that some apps are designed to work differently. Below are some considerations using Adobe Photoshop as an example:

  • If you open an image, Photoshop will ensure it's initial state is at a zoom percentage that allows the user to see the whole image.
  • Now, if you manually click on the Zoom button (i.e. the little green circle at top left of the window) you will observe how Photoshop works with this button. It's typically not very helpful in the case of Photoshop, and it behaves differently to most other apps. This is because Photoshop has multiple windows (e.g. you want the script to work so that it maximises a window while keeping the top bar & task bar, but Photoshop has other windows on screen such as Tools) so the Zoom button only applies to the image window.
  • The only way to essentially change the view of the image in Photoshop is to use the View menu or shortcuts like 0, 1, + or -.
  • Photoshop also uses a tabbed window view by default (i.e. as you open more images, Photoshop opens these in separate tabs within the same window).
  • You may be able to achieve the view you're wanting in Photoshop by changing the Screen Mode (go to View > Screen Mode).

So, I guess what I'm saying is that many applications use multiple windows (or panels). With Photoshop most users will have the Tools panel, the Layers panel, and so on open while using the app. It's the same for most of Adobe's apps and most other creative apps.

You may be able to achieve what you want with a specific script. And you may find the Adobe Photoshop CS6 Scripting Guide a handy reference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .