MACRO: Augment or Transform Text, v8.0

Thank you for this fantasitc macro @_jims!

If it is all helpful to anyone, here is one with just the folding portion and a prompt for the name of the fold, which I found myself using often. You can copy part of the text of the macro you are uploading and then have that be ready to paste into the prompt before you select your text and run the macro.

Fold Selection with Prompt

Keyboard Maestro Forum - Fold Selection with Prompt.kmmacros (38 KB)

You put me on a hunt. I use Ultra Claw (Command+Option+Control+Shift (⌘⌥⌃⇧)) + key (hyper key is a new name for me).

I also added this to your macro so you can easily remove modifiers if you are ever referencing them and easier to read then what I have been using above to discribe them with TextExpander.
If you type in K on the pop up search and then the down arrow once you will see this option.

++++key

I may have referenced it more complicated than it needs to be.

There may be something wrong with my system but this link Immediate Actions doesn't work properly for me. Also for what it is worth some of these "Immediate Actions" already have shortcuts like bold +band italics +i as I am sure you well know.

++++L: Doesn't make a link but it looks like there are two link generators perhaps of different formats?

Can you explain this portion of your macro? When holding Control+Shift or is that just typing those modifiers?

That action opens this macro (Augment or Transform Text) in the Keyboard Maestro Editor. That occurs per the instructions in the main Prompt With List.


BTW, @skillet, here's a tip when uploading screenshots/images to the forum...

If you set the editor to a narrower width before you take the screenshot (or upload a macro), the actions will be easier to read. For example, here's the Switch/Case action at a narrower width.

Keyboard Maestro Export

Great macro @_jims! Are you open for suggestions for an additional range of text manipulations?

1 Like

Sure. Some that you want might already be in a version I’m testing that I’ll be sharing on a day or two. But please suggest now and I’ll try to get them in that version.

Thank you. I will post my suggestions later this week. Good luck with finishing your new version!

1 Like

Oh good point, funny thing is I actually did shrink that down but not enough. That is a lot easier to read!

Oh great, nice to know.For some reason I get this pop up when I press that keyboard shortcut. Probably a system setting I can change though. Sounds like you don't get that popup.

Using Sequoia?

Later today, I'll be sharing Version 8.0 of this macro. One of the changes is this bullet:

I've updated the OP with Version 8.0 of Augment or Transform Text:

  • In local_Additions added Big, Small, Superscript, Subscript, Acronym, Heading 1 to Heading 6.

  • A Hyper+l (i.e., ⌃⌥⇧⌘+l) Immediate Action trigger was configured and intended for Link [text](𝘜𝘙𝘓), but there was a configuration error in local_Additions: the <hk>l: prefix was missing. It has been corrected and is now: <hk>l:[<text>](A_URL)__l1 • Link [text](𝘜𝘙𝘓)

  • Uses the Copy action and the %ActionResult% token rather than the CLIPBOARDSEED() function. A 0.5 second Pause is no longer required due to the new approach.

  • If no text is selected and the Copy action (or Type a Keystroke [⌘C] action) runs, macOS generates a pop sound (at low volume).

  • From the Prompt With List, Configuration Modification is now done using ⌃⇧+any item double click. Previously ⌃⇧Return was another option. This change was necessitated by macOS Sequoia that uses the Keyboard Shortcut ⌃Return to display contextual menus (and unfortunately ⌃⇧Return does the same). For more information, see 50 New macOS Sequoia Features and Changes Worth Checking Out - MacRumors (#46).

1 Like

Nice, speeding things up.

I love your references to things like this, it is very helpful to see where these things changed without having to search them. Thank you for your updates and notes.

1 Like

In this forum, wrapping code in JavaScript or AppleScript appears the same. On the old AppleScript forum, code would open in your default AppleScript editor, and on their new Discourse-based forum, a box appears at the bottom with an "Open in Script Editor" option.

If the code block formatting doesn't provide any of these functions and simply copies the code like plain text, what is the purpose of specifying a particular language when wrapping code?Saving Persistent Values - Code Exchange - MacScripter

Open in Script Editor

use framework "Foundation"
use scripting additions

--the preference value is retrieved at the beginning of the script
set thePreference to getPreference()

--the body of the script goes here and typically sets a preference value
set preferenceValue to {"aa", 3}

--the preference value is saved at the end of script
writePreference(preferenceValue)

on getPreference()
  set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:"com.peavine.test"
  theDefaults's registerDefaults:{keyOne:{"", 0}} --set default value as desired
  return keyOne of theDefaults as list
end getPreference

on writePreference(theValue)
  set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:"com.peavine.test"
  set keyOne of theDefaults to theValue
end writePreference

Syntax highlighting.

2 Likes

Ah, that makes sense, thanks. Do you know how to get that option to open in your default editor like they do on Mac Scripter?

Inspect the page -- you'll see it's a button with an applescript:// URL and the (URL-encoded) script as a parameter.

You're into JavaScript at the moment -- it shouldn't take much to have JS rewrite any code block in your frontmost document window to include the button and script. Whether that's any easier than parsing the Clipboard on any change (macro only active for a KM Forum page) and acting according to content is another matter...

1 Like

Open in Script Editor


Open in Script Editor


Open in Script Editor

Open in Script Editor

Aparently Discourse on this forum strips away the button styles. Not sure if they activated that on https://www.macscripter.net

You misunderstand.

I'm saying that when you load the page in your browser you could run some JS to add the button for you. Not that you should inflict such on every reader of the Forum :wink:

It makes sense to have an "open in your AppleScript editor" button on an AppleScript forum -- not so much here where the snippet may not be AS, may not make sense outside of a KM action, etc.

1 Like

Oh, gotcha, okay, thanks. I don't want to cause others pain. I thought I'd be causing less of it as an option :crazy_face:

1 Like