Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
Apple allows users to define keyboard shortcuts for just about any command in a menu (if you spell it exactly right). You will see the shortcut displayed next to the command in its menu. For example, I use control-option-commmand+up-arrow to move a window to the upper monitor and the same with down-arrow to move it down. Tends to work like a charm — unless you are using Acrobat Reader DC, that is. Those keyboard shortcuts do not display when Reader DC is being used. No other app I use does this. Very annoying as I have to use Reader DC daily. I think this is a bug in that the app is not paying attention to something in the OS that it should be. Right?
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
That's an interesting theory but could only be checked out by choosing another shortcut using a key that is not used in any other shortcut by Acrobat Reader DC. I searched for ' (yes, an apostrophe) in the list of shortcuts you linked because most other keys are associated with other commands. It wasn't used elsewhere so I replaced the down arrow shortcut with the apostrophe. No luck. Not only does it not work, but it also/still does not even display the shortcut in the menu when Reader DC is in the foreground whereas other apps did when they were in the foreground. I am more convinced Adobe is doing something bad here by not adhering to something in the OS that it ought to.
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
Apple allows users to define keyboard shortcuts for just about any command in a menu (if you spell it exactly right). You will see the shortcut displayed next to the command in its menu.
How exactly did you set up the shortcuts control-option-commmand+up-arrow/down-arrow?
Where is the menu with that command?
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
Check out

Make sure you get the spelling of the command EXACTLY right — it is case sensitive.
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
I see. For some reason, macOS returns "You cannot add keyboard shortcuts for the application Adobe Acrobat." when trying to add a shortcut for Adobe Acrobat.
Acrobat.jpg
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
I added the keyboard shortcut for ALL apps (and received no such warning). Everyone plays well with Mac OS except Adobe. WTH?

It wouldn't be so bad if I had to set up these keyboard shortcuts within Acrobat Reader DC, but that app doesn't have that functionality, unlike some of Adobe's other apps.
 
Last edited:

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
It might be fixable
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
It might be fixable

It was kind of you to supply that info, though it is way above my brain's pay grade. I don't know how to script and couldn't understand most of what was on the linked pages.
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
It’s beyond me as well. An app developer might enlighten us.

But you can use a dirty trick, tell Acrobat to click the menu item move. :)
Create a new Quick Action in Automator
https://support.apple.com/guide/automator/use-quick-action-workflows-aut73234890a/mac
Workflow receives – no input in Adobe Acrobat
Run AppleScript, tested with Acrobat Pro DC

Code:
tell application "System Events"
    tell process "Acrobat Pro DC"
        click (menu item 1 where its name starts with "Move to") of menu 1 of menu bar item "Window" of menu bar 1
    end tell
end tell

Save the Quick Action with a name (MoveAcrobat) and then define a shortcut from System Preferences – Keyboard – Shortcuts – Sevices.

MoveAcrobat.jpg
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
Seems like it would have to be a different keyboard shortcut for Reader DC than other apps though.
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
You are very kind to try and help but I'm still struggling to understand how to use Automator to do this. I don't understand the "Add actions to your workflow" part of the instructions on the page you linked.
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
In the upper-left search field, search for Run AppleScript and drag it to the right side. Copy-paste the code above instead of the default one (on run {input, parameters}....)
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
Haha, I didn't know you had to drag the Run Applescript bit to the window on the right. OK, so I did that and pasted in the commands above. However, it still doesn't work for me. I do see it under Services in System Preferences -> Keyboard Shortcuts and gave it a shortcut keystroke.

I noticed that your commands call the process "Acrobat Pro DC" but in my Activity Monitor it is called "Acrobat Reader" so I tried to use that instead and still did not have any luck (I also tried the name of the app as displayed in the App Switcher, since that is different still but no luck). Screenshot with Activity Monitor also visible to show the process name. Thoughts?

1663351425265.png
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
It should work with the name displayed in the Activity Monitor.

You can try to drag-drop the Adobe Reader app from Finder into the script, between the “”, instead of the name. Don’t worry, it won’t put the whole app in the script, just the path :)

Or try this version
Code:
set ActiveApp to short name of (info for (path to frontmost application))
tell application "System Events"
    tell process ActiveApp
        click (menu item 1 where its name starts with "Move to") of menu 1 of menu bar item "Window" of menu bar 1
    end tell
end tell
 
  • Like
Reactions: larryleveen

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
Correction: the first suggestion from the previous post doesn’t work, as tell process will not accept the path.
The script with set ActiveApp works as expected in Big Sur and Monterey.
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
HOLY CRAP, IT WORKS. Apparently, I also had to quit and reload Acrobat Reader DC. Then, when I tried the shortcut, I at least got an error/warning that the app didn't have permission to do such and such a thing, so in System Preferences, under Security & Privacy, I gave it permission.

The odd-ish thing is that since the code is written to say "do the Move to command" there is no differentiation between external and internal monitors which I previously gave up and down arrow keys. I opted for the same modifiers and the right arrow key to handle both movements. I look at it as "move to the next monitor". But anyway, it works. Thanks very much. I've already used it a bunch today.
 

bogdanw

macrumors 603
Mar 10, 2009
5,838
2,835
I regarded one script that works regardless of the name of the external monitor as a plus. :)
But you can use two qucikactions, with the name clearly defined, in order to have different shortcuts for moving the window to the external or internal display.
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
I regarded one script that works regardless of the name of the external monitor as a plus. :)
But you can use two qucikactions, with the name clearly defined, in order to have different shortcuts for moving the window to the external or internal display.
"IT'S A FEATURE, NOT A BUG!" ;)

Thanks again!
 
  • Like
Reactions: bogdanw

jxl

macrumors newbie
Nov 3, 2022
3
0
"IT'S A FEATURE, NOT A BUG!" ;)

Thanks again!
larryleveen, would you mind posting a screenshot of the exact syntax you used? I'm trying to accomplish the exact thing you are, and haven't been able to make this work in Automator. No matter what I try I get syntax errors.
 

larryleveen

macrumors member
Original poster
Oct 12, 2011
78
17
larryleveen, would you mind posting a screenshot of the exact syntax you used? I'm trying to accomplish the exact thing you are, and haven't been able to make this work in Automator. No matter what I try I get syntax errors.
I hope this is helpful to you. I'm a dunce at this stuff and as you can see it took me a long time to get it to work. I'll also paste in the text in the AppleScript itself below the screenshot. Good luck!

1667506146225.png



set ActiveApp to short name of (info for (path to frontmost application))

tell application "System Events"

tell process ActiveApp

click (menu item 1 where its name starts with "Move to") of menu 1 of menu bar item "Window" of menu bar 1

end tell

end tell
 

jxl

macrumors newbie
Nov 3, 2022
3
0
Thank you! Still erroring out for me, so I'm hoping someone else has a clue. Googling has been less than helpful. Screenshot of the error (and the script):
Screen Shot 2022-11-03 at 5.02.48 PM.png


I originally assumed that this entire piece "(info for (path to frontmost application))" needed to replaced with the path to the application, but any combination of ways to do that also produces a different syntax error.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.