Hello all,
I am most reluctant to pop up this query.
But honestly, after scrounging around in the Wiki, I realise this is something that will take presumably take a seasoned KM user a few seconds to assist with, but will/is taking me hours to get my head around…
I have come back to this on several occasions over the last few years, but the entry-effort is just too large, and each time, after a few hours of trying to get it working, I drop things (arguably more confused than before!)
I realise there is untold power in the KM Clipboards, and the variables, tokens etc., but the time required to work it all out, is preventing me from using them, and it’s no-doubt cutting off a sizeable chunk of KM use…
I am hoping someone can help me with the below, since once I see how it should be done, it will open up all sorts of other possibilities, hopefully as a result of me “finally getting it!”
If this is not the right way of going about doing this, then please tell me to 'bugger off, and work it out on your own - you will appreciate in the long run etc. etc."…
What I am doing, and want to fix using KM:
- I saved 3 types of PDF files off our CMS, over and over again, on a daily basis.
- The CMS displays client data, including the [NameSurname] and [ClientID], that is fortunately selectable, and so can be copied.
- Open saving/printing the PDFs, one by one, I use a Textexpander snippet that fills in the [date], then a [standard description of that PDF page] (to distinguish between the 3 types of PDF pages I download from the CMS for each client), followed by me then pasting in the [NameSurname], and then pasting the [ClientID], as copied earlier.
- I use Alfred’s clipboard manager in this – and I am then left with 3 different PDFs, that all have essentially the same filename structure to them, barring the 3 different PDF descriptors (inserted by TextExpander, after invoking 3 different snippets at each PDF save).
- When the PDFs are dropped into a specific folder, Hazel works her magic, and automagically sorts the PDFs into the relevant Client folder (assuming it exists, failing which, Hazel creates the folder) – by recognizing the text-pattern that TextExpander ensures I apply to the filename of each PDF.
My steps:
1.) I manually select the [ClientID] off the screen, and [Cmd+C] Copy to System Clipboard.
2.) I manually select the [NameSurname] off the screen, and [Cmd+C] Copy to System Clipboard.
3.) I use KM to fire off the SaveAsPDF procedure.
4.) In the Save Dialogue box, after clicking into the filename, I invoke the individual TextExpander snippet, which pops up a floating text entry window. The [date]_ [PDF description] _ is already taken care of by TE, by each individual snippet.
5a.) I hit [tab] to jump over into TE’s blank field, where I am now to paste the [NameSurname].
5b.) I hit [Cmd+V], and paste in the last copied item, which is the [NameSurname].
5c.) I hit [tab] to jump to the next TE blank field, where I am now to paste the [ClientID].
5d.) I invoke Alfred’s clipboard manager, tap down once to the previously copied item, which is the [ClientID].
5e.) I hit [enter], which pastes the [ClientID] from Alfred, into the text field.
6.) I [tab] twice more to [OK], hit enter, and the file is named correctly, for Hazel to do the sorting.
7.) I repeat steps (3.)-(6.) for the next PDF [using a different TextExpander snippet at step (4.) – containing the other PDF description];
8.) I repeat steps (3.)-(6.) for the third and final PDF [using a yet another TextExpander snippet at step (4.) – containing the other PDF description].
Friction!
As is clear from the above, whereas this process could have been even more tedious were I not using KM, TE, Alfred and Hazel – it’s far from ideal, since I am fairly certain(?) that KM could jump in here, and take out even more steps… Correct?
What I surmise I need to be doing:
1.) Select and copy the [NameSurname].
2.) Make this a [Variable]??, and add it to a named clipboard [Firefox1].
3.) Select and copy the [ClientID].
4.) Make this a [DifferentVariable]??, and add it to a different named clipboard [Firefox2].
5.) Have KM create a third different named clipboard [Firefox3], using the Date variable and Text(??) variable, to create the [date]_[PDF description1] part of my TE snippet for the filename naming-regime.
6.) Add [Variable] from [Firefox1], and [DifferentVariable] from [Firefox2] into [Firefox3].
7.) Invoke KM to trigger the PDF save/print feature.
8.) Have KM click into the filename field, paste the content of [Firefox3].
9.) Have KM [tab] through to save the file with the new filename.
This appears longer, but since KM is doing everything in the background to the copied text, I am merely triggering KM once, at step (7.)
That said – I know I have missed several things above already. Presumably there is a far better way to do what I am trying to.
But assuming for a moment that that can work as is – and ignoring the fact that I have no clue how to actually get KM to do all of that, especially the using of the variables, and knowing in what order the writing to/copying from etc. must be happening in >> the real issue arises when I need to repeat all of this, for the other two PDFs…
Do I now create new named clipboards, to re-create the correct PDF description for the 2nd and 3rd PDFs, before pulling in [Firefox1] and [Firefox2] each time again?
I hope the above makes sense, and that I am clear in what I do, and what I want to do differently.
Putting me out of my misery:
Whereas an answer to the effect of “do this, then do that”, will be much appreciated - I am really holding thumbs that someone could pop up a screengrab (or 1st prize, share a test Macro) that will do the above…
I am obviously keen to try and get this sorted myself, to learn along the way, but the above is all broad-strokes…
My challenge lies in not really understanding the nit-picky details of how each step should look, in using the variables/tokens, and passing text from one clipboard on to another…
So even where I can get clarity on the “do this, then that” part in order to streamline things (rather than going my convoluted suggested way above), that will get me further, but I fear I will still get stuck in the details of actually compiling the macro.
Hoping some kind soul will take a bit of time, and help me out!
Much appreciated!