What would be better: Named clipboards, or Variables?

Dear all,

Despite being quite comfortable in using KM over the years, and stringing together some workflows/macros that have saved me so much time, my KM nemesis remains that of using variables/named clipboards more effectively. Rather, using them at all!

I do not know why, but unlike the rest, I just never got my head around it properly enough to use, and haven't put enough time aside to make sure I get something simple up and running, to work from...

I have now reached the point where a particular repetitive, daily action I do countless times a day, is annoying me enough in realising it could use some variable/clipboard magic – and want to now fix it once and for all!

As such, would really appreciate some initial guidance:

I use TextExpander when saving specific PDFs from our CMS, to ensure a consistent naming pattern, so that Hazel can then sort and file the saved PDFs into their appropriate folders.

The TE snippet, places all the appropriate placeholder text into the save-dialogue for the filename, but requires 2 inputs from my side, that I want to automate using KM, and its variables/named clipboard.

The name-template looks like this >> date_file-type description_Name & Surname_ClientID

I must therefore manually paste the Name & Surname and ClientID into the TE snippet.
I want to stop having to do this, and get that information from my clipboard/variables...

To get to the place where I download the PDFs from, which are to be renamed, the following happens:
1.) The ClientID is copied and placed onto my "general/standard/system" clipboard.
2.) I open the CMS website, and paste the ClientID into the CMS search field.
3.) The page to be saved as a PDF is shown. I manually select the Name & Surname from the page, and also copy it into my "general/standard/system" clipboard.
4.) I select a "Print Page" UI portion of the screen, to generate a specific document printout of the screen (which is more readable than the overall "print screen" option), and then follow the steps to save that as a PDF, and rename from there using the TE snippet above.
NOTE: Steps 1, 2 and 4 are already automated, using KM.

Because I use Alfred's clipboard manager, both the Name & Surname and ClientID are very easy to get to, since they appear at 1st and 2nd place, in Alfred's clipbord history viewer – which I then select and paste out again, as needed.

So – to be clear, both the ClientID and the Name & Surname fields, make their way onto my general clipboard during the process in any event.
When I invoke the TE snippet, I then use Alfred's clipboard history to quickly select either of the two, and "paste" it into the relevant text entry field of the TE snippet, and repeat this for the other one, before hitting enter and having TE override the default filename with the new version.

Question: Since what I need to fill into the TE snippet is already on my clipboard, I presume I simply need to find a way to get those two respective fields into either a named clipboard, or a variable, to then be used by KM (instead of TE) to paste that into the desired filename, by using both variables/named clipboards in the appropriate places...

Which one would better suit my needs? Variable, or Named Clipboard?
Knowing this, I can then start doing my homework...

Ok.

I have now managed to create a series of macros, in my Experimentation group, and seem to have them working.

My way is probably waaaayyyyyy too klunky, but it's working for now!
But I am now hitting some organisational/trigger problems that I'm not sure how to work around.

Two of my new macros do the following:
1.) Macro A takes the clipboard content (my ClientID) and copies that to named Clipboard 1.
2.) Macro B takes the clipboard content, after I have opened the correct page and selected the clients name (my Name & Surname) and copies that to a different named Clipboard 2.

A third macro – which presumably needs to run at specific times?? – then:

3a.) Sets named Clipboard 1 to plain text Variable ClientID, and then sets named Clipboard 2 to plain text Variable Name & Surname;
3b.) And then combines those to variables into a new variable that is Name & Surname_ClientID.

I use the 3rd variable to paste the newly combined text into my filename.

Question:

How do I actually manage all of these?

In other words, since I am copying the ClientID out of Outlook, and then later, the Name & Surname out of Firefox – how to I set the 3rd Macro up to only build the new combined variable that can be pasted when I need it?




EDIT >> OK! :laughing:

At risk of having a conversation with myself, seem to be making progress.
Have created a global conflict pallette that allows me to select either the ClientID or the Name & Surname, and then fire off the corresponding macro (depending on what has been selected), to add the selection to the appropriate named clipboard.

From there, I then invoke the same shortcut to bring up the Pallette again, and then trigger the "combine" named clipboards, to have the Name & Surname_ClientID variable created.

This last variable can then be inserted into the filename, when needed.
Still quite a bit of manual processing, but far less than before – so pleased to be making a bit of headway!

you can:

  • Merge macros A and B, and
  • add two While actions

some idea of the flow:
1.- You run the macro and grab (my ClientID )
2.- the first While waits for you to press a Key, ie F1
3.- you press F1
4.- The second action runs (my Name & Surname )
5. the second While waits for you to press a Key, ie F1
6. you press F1
7. Another action combines my ClientID and my Name & Surname. You can store that in a variable and the clipboard
8.- Pass it to the filename

Oh wow – did not know about while !

Will give this a bash!

I might have wanted to say use Pause Until

image

1 Like

Hey Neal,

My general rule-of-the-thumb is to use Variables for all plain-text items I want to save and to use Named Clipboards only for styled-text or other data incompatible with variables (which are plain-text only).

-Chris

2 Likes

Please see TIP: Understanding KM Variables, Tokens, & Functions

Variables vs Named Clipboards

In answer to your main question: "What would be better: Named clipboards, or Variables?"

==There is no reason, no advantage, to using Named Clipboards over Global Variables ==, UNLESS you need something other than plain text stored in KM Variables, like images, rich text, objects, etc.

I scanned, but did NOT read the remainder of your post: TL;DR.

If you have specific questions about using KM Global Variables , please post in a new, separate, and please be succinct.