Jump to content

Is this possible with Alfred? (transforming highlighted text)


Recommended Posts

Posted

I use Scrivener, a Mac app for writing.  It lacks an extension/plugin system and has no AppleScript support (unfortunately).

 

I have a Microsoft Word macro kit that will go through a piece of text and highlight weak verbs, overuse of prepositions, and other grammatical faults.

 

I'd like to do the following:

  • Highlight a block of text in Scrivener
  • Invoke Alfred
  • Magic happens
  • Microsoft Word opens, the text is pasted in a new doc, and the macro is run
  • BONUS: Ideally a new section is created in Scrivener with the highlighted text pasted back and Word is closed

Alternatively

  • Highlight a block of text in Scrivener
  • Invoke Alfred
  • Alfred invokes some AppleScript/something I write, does the highlighting work, and pastes the text back

I can browse through Alfred's docs to see if this is possible and how I might do it (and write the AppleScript stuff) but before I go down that path, I'm wondering if this is possible in Alfred/a good candidate for an Alfred workflow.

 

As you can tell, I'm rather new to Alfred :-)

 

I do have the Powerpack if that is significant.

 

Thanks very much for any advice.

 

Posted

I do have the Powerpack if that is significant.

It is, you wouldn’t be able to do it without it, but it should be very much doable, yes.

As for the “Magic” part, that’s on you to build, but the most important but there is “can Alfred work with a highlighted piece on text?”. It can. Look into workflows Hotkeys, as the option is there.

Posted

You might look at the hotkey version of the Case Converter workflow: http://www.alfredforum.com/topic/2180-case-converter-including-title-case/?hl=%20case%20%20converter

 

One possible hitch will relate to loss of formatting in the trip from Scrivener -> Word -> clipboard.  If all of the modification is done in Applescript in Word you might be ok.  But most of the other text conversions out there are based on command line utilities &/or python & other languages that typically don't readily support .rtf or other rich formats to keep the formatting.

Posted

Yes, the Funnel workflow - http://www.packal.org/workflow/funnel

 

Select a block of text, trigger the workflow with the pipe character '|' a space, and then the filter you want to run against the text, e.g., case conversion, html encoding/decoding, markdown conversion, etc.

 

You need to be using the very latest release of Alfred.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...