Modifier Not Working

I am trying to create a Macro that involves (amongst others) clicking on a paragraph style in an InDesign panel while holding the ALT-key (on a Mac). The clicking works perfectly fine but the modifier isn't recognized and ignored and hence the style isn't applied as I want it too. I am using the 'with modifier' option within the action in KM.

Any idea's to get an ALT-left-mouse-button-click recognized and working?

Hi and welcome to the forum! :wave:t3:

I don't have InDesign, so I don't know what ⌥-clicking paragraph style does, but if the same function has a menu item, you can use that instead.

Post your macro so we can see if there's something you missed. :+1:t3:

Well, in fact this is all: I click in a window with ALT being pressed. There is no way to do this using a menu.

The 'with modifiers' option, which has the correct key activated, is simply ignored.

Sorry, what I meant was... what does ⌥-clicking that menu do? There might be an alternative way to achieve it than clicking with a modifier held. I can't see any error in your macro, so perhaps the app has some odd way of interpreting clicks. This doesn't seem likely, but no other explanation is forthcoming.

If there is another way than this click-action, that is certainly better, @noisneil is right. I don't have InDesign either and can't try anything.

But if there really is no other way, you can try this. Take out the modifier in the macro. Add a pause before the click action. Choose a trigger with ⌥. If you execute the trigger and hold ⌥, the result should be ⌥+click ... maybe :smiley:

2 Likes

Another thing to try is to separate the actions:

  • Just move mouse to found image.
  • Pause (may not be necessary).
  • Click at current mouse position with modifier.

InDesing incredible mess for a non-graphic designer. :hot_face:

I did some quick research, apparently these panels are fully keyboard navigable (tab, arrows, enter). That should help with a KM macro.

And additionally shortcuts can be assigned to these actions. Edit -> Keyboard shorcuts. If I have understood this correctly :smiley:

Thanks for all the help so far! I had another look at it and maybe I should skip the step I am trying to accomplish and 'cut' the macro I am creating in two. I think I am trying to do too many things with just one macro and in the end it might work better with my workflow to keep certain things seperated.... which sort of eliminates the need for this ALT-click part. (BTW I just noticed the ALT button is called OPTION on a Mac... :wink: ) If I do find a solution anyway I will post it here. :wink:

Looks like you are trying to "Clear Overrides"? AFAIK you can't do it directly by modified-clicking, but you might be able to do it by Control-clicking the style in the palette and then selecting from the contextual menu (Control-clicking does work, for some reason!).

Yes, indeed, "clear overrides" is what it is called! Unfortunately the Control-menu doesn't offer that option. I did see the menu in the panel itself offers the option but it seems a bit hard to get it activated by clicking. However, just now I noticed the arrow keys work with that menu so I will give that a try. But I do wonder if the time it will take this macro to do its job is worth it, specially since, as I posted earler, it might be better for my workflow to not create on huge marco 'to do it all'. But I will experiment a bit with it. :wink:

InDesign 2020 gives me:

... when KM-driven Control-clicking a style, but perhaps "Apply..., Clear Overrides" isn't the same thing?

Targeting the click could also be an issue so, yes, perhaps better to do it elsewhere.

InDesign is highly scriptable though, and the AppleScript dictionary includes:

apply paragraph style v : Apply a paragraph style.
    apply paragraph style specifier : Supported by the following objects: text, character, word, line, text column, paragraph, text style range, insertion point.
        using paragraph style : The paragraph style to apply.
        [clearing overrides boolean] : If true, clear any text attributes before applying the style. Can accept: boolean (Default: TRUE).

... so perhaps you'll find something going that route.

Well... that's interesting... Thanks for that screenshot, Nige_S! I actually never noticed this option before...! I checked it this morning after reading your post but totally missed it...!

However, I noticed a problem with this: the option to apply a style AND clear overrides is only available in that menu when there actually ARE overrides... When there are no overrides the option simply isn't there at all. The problem here is that the text I am trying to apply the style to sometimes does have overrides but not always... which means that if I could make a macro that would apply the style and clear overrides it would return an error whenever there are no overrides. (It's getting complicated LOL) I do suppose KM offers an option somewhere to only apply a certain step IF certain conditions are met... I'd have to check that out...

Okay, so I found the IF THEN ELSE option in KM but it won't work with the submenu's I have to use... Bummer. I do have the option to apply the style AND clear the overrides working, so that's a step forward already, but whenever there are no overrides the macro simply select the NEXT item from the menu which isn't what I want, of course. Pity there is no 'regular menu' option to do all this in InDesign.

There will be a way of doing it, even if that's a local "Detect Image..." looking for the "Clear Overrides" part of the contextual menu. But my first question would be "Why are you trying to clear overrides on something that isn't overridden" :wink: Do your detection earlier, IMO.

Actually, my first question would be "Why are you doing this in the first place?". Overridden styles points to a process problem -- incorrectly mapping styles on text import, users not adhering to style guidelines, required formatting not available as a style, etc -- and the earlier in your workflow you sort it out the easier your life will be.

But I'm old-school -- bring back PageMaker, preferably the version before Adobe got their hands on it!