How to get the window bounds for “Adobe Illustrator” in AppleScript

adobeapplescriptscript

Apparently, Adobe doesn't have a single mechanism in place for people using a laptop and additional monitors with their products. As an Adobe CC user who primarily works from a laptop that connects to a larger monitor at home or school, ALL Adobe CC products open with a pop-up window that is outside of the monitor bounds. So you can't move, or adjust, anything.

It effectively locks the product.

The only workaround is to disconnect the monitor, wait for everything to shift over to the LapTop window where it makes sure to open everything inside of the monitor bounds. Then reconnect the monitor, and move everything over. Which is a MASSIVE time waster when you're dealing with 8gb of RAM and MASSIVE graphics files.

I've started learning AppleScript JUST TO FIX THIS RIDICULOUS GLITCH.

BUT… AppleScript and Illustrator don't work with windows and bounds together.

Can someone help me with whatever script I would have to write to get (and set) the Adobe Illustrator window bounds?

Best Answer

Here's a piece of code that just gets desktop's dimensions and transfers them to another application's first window.
Exchange "TextEdit" with Illustrator's process name and build yourself a Service in Automator (open "New", choose Service, draw "Do AppleScript" to right, insert this code ...).
Give it a shortcut via [ System Preferences > Keyboard > Shortcuts > Services ] and get going!
Hope this helps ...

tell application "Finder" to set myBounds to bounds of window of desktop

tell application "System Events" to tell process "TextEdit"
    set position of window 1 to {0, 20}
    set size of window 1 to {item 3 of myBounds, (item 4 of myBounds) - 20}
end tell