Ok nope, I'm doing something wrong. Here's what I have so far:
But while A works, B gives me:
What am I doing wrong?
EDIT: I think @Nige_S found the problem while I was posting.
Ok nope, I'm doing something wrong. Here's what I have so far:
But while A works, B gives me:
What am I doing wrong?
EDIT: I think @Nige_S found the problem while I was posting.
Dang it, what am I missing? I downloaded yours and it worked great, but when I tried to change it like so, only modifying the Unicode points, it isn't working now:
All I changed was the name and the Unicode point! But now it doesn't return a character, just gives me the popup. Sorry...
PS: I tried renaming each one to start with A, B, C, but no change.
That's the conflict palette, as KM sees all those macros that start with the same letters and have the same shortcut, so it's offering to let you pick which one you want. As @Nige_S points out, if you name them with unique first letters, you can then just type different letters to pick the right macro in the palette.
But I think what you really want to do is change the shortcuts so they're not all on the same key :).
-rob.
Ok, thanks for everyone's patience. I corrected the error and found the best solution for me, which has the added bonus of not needing to turn it off!
For no better reason than to show "there's more than one way to do it" -- here's a version that uses a typed string trigger (often referred to as "text expansion").
My typed string triggers always begin and end with ;
to make them "obvious" to KM -- and it also makes it easy to parse the trigger value for "multiple choice" macros. And that's what we're doing here -- it'll take whatever characters are between the ;
s and "Switch/Case" match them to an action: ;0;
will be replaced with a superscripted 0
while ;+0;
gives your old-style numeral, etc.
The downside will be a rather long "Switch/Case" action, making maintenance more difficult. An upside is that you have a single "type a funky char" macro rather than dozens of individual ones. You could, of course, split the difference -- have one macro that processed all the replacements that start with +
in your original table and another that did the rest, or one that processed all the numerical replacements (;[^\d;]*\d+;
is my untested guess at the trigger) and one for the non-numerical (;[^\d;]+;
).
Typed String Special Chars.kmmacros (4.5 KB)
Ok, I’ve run into a little problem. Because this script is technically pasting the characters, some programs (like InDesign) add a space before and after the character.
I tried changing to input as type instead of paste, but it doesn’t seem to work. What’s the solution for this? Thanks.
Which script is? A quick check of what's above suggests that most, if not all, are inserting text by simulating keystrokes. It's only yours that is pasting. So check your actions, or post the relevant part of your macro.
It may, of course be that "funky characters" do require pasting even when added with a "by typing" action. I turn off "smart paste" whenever possible, finding it more often wrong than helpful...
You're explicitly inserting text by pasting -- try changing that to "Insert text by typing" and see if it solves your problem.
You often have to choose which of the two to use depending on how the target program "reacts" to either input method. For example, I use "by typing" for most things in the FreshDesk web app because pasting doesn't work properly in most input fields, by switch to "by pasting" when adding angle-bracket delimited links (<https://www.example.com>
) because otherwise FreshDesk will create a clickable link that includes the brackets, making it unusable.
Thanks. When I switch to "Insert text by typing," it doesn't work.
Is this still in InDesign? I hate to say it, but the "SING CURL RIGHT" macro works fine in InDesign for me with "Insert by typing".
Does it do anything, or does it not insert any character at all?
If you do have to use paste and don't want to permanently turn off smart paste (Preferences->Type->Adjust Spacing Automatically...) you can do it on a case-by-case basis with AppleScript. To turn off:
tell application "Adobe InDesign 2024"
set smart cut and paste of text editing preferences to false
end tell
...and to turn back on:
tell application "Adobe InDesign 2024"
set smart cut and paste of text editing preferences to true
end tell
Adding those to the beginning and end of all your macros will be a total PITA, so you might want to fire off the first to start a "dumb paste" session, do what you need, then fire off the second to return to "normal". Personally, as said before, I'd just leave it turned off!
@Nige_S, thank you for sticking with me. SING CURL RIGHT works with "Insert text by typing," but this one does not: