Ability to Assign Highlighting to a Hotkey

I would like to request the ability to assign Highlighter Colors to a HotKey. I realize that there is the button that opens the whole set, and the drop-down list in the right-context menu that can be used.

I am not suggesting they must be added as Hotkeys when the program is shipped, only available to be placed onto hotkeys via the Shortcuts setup feature, or something like that. And being able to assign shortcuts to the list shown in the right-click context menu would be fine.

Then I could decide if I need/want to dedicate keys to highlights (which I really do!) and can select whatever key combinations that work for me.

Whaddaya think? Is this doable?

Thanks!

JWhitten

[Just realised, you may not be on a Mac. I don’t know if this is possible in Windows without a third part solution, sorry…]

You can add shortcuts for highlights in the normal MacOS way — just create them in System Preferences > Keyboard > Shortcuts > App Shortcuts.

Make sure you enter the menu item exactly, then they’ll appear in the Scrivener menu.

HTH.

Thanks for the suggestion, but that doesn’t work in the windows version.

Yes — you didn’t mention in your original post which version you’re on and it only occurred to me after I’d posted that you might be on windows…

Unfortunately, Windows as an OS lacks some features which come as standard on the Mac, and it must be difficult for the programmers to replace them all in house (or for me to remember which features don’t make the cut :grinning:) Hopefully, Scrivener developers will add more shortcuts as time goes on.

1 Like

Yeah, I’m not knocking anybody. Scrivener deals with highlighting better than any other program I’ve tried (though maybe Word does it better, IDK)… But I use highlighting extensively as a visual aid to remind myself of various things about the text I’ve selected. Orange for revision, red (rose) for delete, yellow for important, probably should revise, blue & green for important (similar to yellow-- I use them typically when sequences / steps matter). And also the CLEAR highlighting. If nothing else, I could live if just orange and clear were on hotkeys :slight_smile:

1 Like

Hi jwhitten,

You might want to update Platform in your profile to note you’re on the Windows version. :nerd_face: I’m not sure how many people actually check, but I do.

Best,
Jim

2 Likes

Didn’t know I could do that. Thanks for the tip!

John

1 Like

Hi John,

If you do Ctrl+Shift+H, Scrivener will highlight any selected text with the last used Highlight color.

Wasn’t sure if you were aware of that, but it’s a feature available now in Windows Scrivener.

Best,
Jim

2 Likes

Thanks Jim, I did see that just now as I was looking through the shortcuts. If I can remember what the last color was I used, it’ll come in handy!

John

Try one of these. I use Karabiner and Keyboard Maestro, extensively.

hot key solutions

Hi John,

Here 's an Autohotkey script that would do what you want.

Ctrl+Shift+1 highlights text in Cantaloupe.

Ctrl+Shift+2 highlights text in Pink Marker.

The script works by doing Alt+ R, H, arrow down x 3, enter. (Selecting Cantaloupe)

You can assign different hotkeys by tweaking the script, but avoid using Alt as your hotkey. And you can change the color selected by changing the Down count. Of course, you can add more hotkeys and colors.

Let me know if you have any questions about how to set up Autohotkey.

Best,
Jim

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;--------------------------------------------------------------------------	

SetTitleMatchMode, 2

#IfWinActive ahk_class Qt5153QWindowIcon

;--------------------------------------------------------------------------	

^+1:: ; Ctrl+Shift+1 =  Cantaloupe

Send !r
Send h
Send {Down 3} ; Cantaloupe
Send {Enter}

return


^+2:: ; Ctrl+Shift+2 =  Pink Marker

Send !r
Send h
Send {Down 4} ; Pink Marker
Send {Enter}

return


Thanks!

I was wondering if I could do it with AutoHotKey, and now you’ve saved me the trouble!!

Much appreciated.

John

I have AutoHotKey installed-- can you give me a couple of quick tips how to get this script loaded-up and running? I’ve got years of programming experience, but haven’t used AHK yet, apart from installing it.

John

Hey - It worked !! :slight_smile:

Thanks

To anybody who’s interested, here’s an updated script, using the same key setup (CTRL+SHIFT+1 through 6) for the markers.

Here’s a screenshot for reference:

And here’s the AutoHotKey (.ahk) Script:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;--------------------------------------------------------------------------	

SetTitleMatchMode, 2

#IfWinActive ahk_class Qt5153QWindowIcon

;--------------------------------------------------------------------------	
;; CLEAR

^+1:: ; Ctrl+Shift+1 =  CLEAR

Send !r
Send h
Send {Down 1} ; CLEAR MARKER
Send {Enter}

return

;--------------------------------------------------------------------------	
;; YELLOW (Banana)

^+2:: ; Ctrl+Shift+2 =  YELLOW 

Send !r
Send h
Send {Down 2} ; YELLOW MARKER
Send {Enter}

return

;--------------------------------------------------------------------------	
;; ORANGE (Cantaloupe)

^+3:: ; Ctrl+Shift+3 =  ORANGE 

Send !r
Send h
Send {Down 3} ; ORANGE MARKER
Send {Enter}

return

;--------------------------------------------------------------------------	
;; RED (Pink)

^+4:: ; Ctrl+Shift+4 =  RED

Send !r
Send h
Send {Down 4} ; RED MARKER
Send {Enter}

return

;--------------------------------------------------------------------------	
;; GREEN (Honeydew)

^+5:: ; Ctrl+Shift+5 =  GREEN

Send !r
Send h
Send {Down 5} ; GREEN MARKER
Send {Enter}

return

;--------------------------------------------------------------------------	
;; BLUE

^+6:: ; Ctrl+Shift+6 =  BLUE

Send !r
Send h
Send {Down 6} ; BLUE MARKER
Send {Enter}

return
2 Likes

BTW – to the DEVS –

I’d still like to request this ability get built into the program, so I don’t need an external program to make it work.

Thanks

(And thanks everyone for all their help!!)

John

You can do it easily with character styles. That makes it simple to remove all formatting of a specific color by redefining the style or deleting it. Don’t forget to override those styles in Compile to remove the highlighting (if you don’t want to Compile it).

That does work with compiling and whatnot. But the highlighting is dynamic-- or maybe better, on-demand / as-needed. I set it to flag an issue. I clear it later when the issue is resolved. In between, I have requests to read, and often send out a version of the WIP with the highlighting intact. So the solution to be able to show/disable it in compiling is good. With regular compiling, I can do it with one switch (remove highlighting). But that’s a minor difference, and YOUR solution might actually turn out to be more adroit, given that I could turn on/off styles by style.

The solution Jim suggested, with the AutoHotKey script, is a good workaround. I modified it a little (even from the one I posted) so that CTRL-7 through 9 are Orange, Red, and Green. CTRL-0 is Clear Highlighting. That fit in with the Scrivener shortcut keys and covers 95% of my use cases.

But I still would prefer the highlighting be available to apply via shortcuts within the program. I don’t care if they’re not hooked-up. There is a facility to defining shortcuts to functions. Just stick the Highlight functions in there, and if I care, I’ll figure out how I want to add them. IMO, I would consider that “Job Done”.

I still like your suggestion though. I think it could come in handy for a variety of other things I’d like to be able to do. The biggest one is to be able to turn off the “Goals” section of my way of doing it when I compile.

The clear advantage of my approach is removing all highlighting of a given color in one go in the Editor, not just in Compile. If the “remove all highlighting” switch overrides character styes (I’d have to test that), I think the other method has no advantages at all.

I don’t think the “remove all highlighting” button changes the character style, just removes the colored background.