From the Dept. of Mundane Conveniences:
NEW STICKY NOTE FROM CLIPBOARD.kmmacros (7.8 KB)
(uploaded in disabled state and without a trigger)
Speaks for itself:
From the Dept. of Mundane Conveniences:
NEW STICKY NOTE FROM CLIPBOARD.kmmacros (7.8 KB)
(uploaded in disabled state and without a trigger)
Speaks for itself:
When a macro works, it works. However, you could, if you wished, avoid the duplication of Activate Stickies
and the following Pause
each time, since they are common to both outcomes of your If
statement.
Just one pair of Activate Stickies
and Pause
could be used, before the If
action. Then change If
so that the Type a Keystroke
action is run if Stickies is running.
Is there any point in having a Pause
after Filter System Clipboard
, I wonder?
As for the Pause
after Activate Stickies
, you could for this sort of thing try using Pause Until
rather than adjust the timing.
Pardon the inconsistent use of "light" mode in that screengrab; I find "dark" mode very disorientating!
Thank you for these suggestions. The reason I tend to build a lot of pauses into my macros is that I'm using an 8 year old Air that has RAM challenges and can sometimes take time to transition from one state or action to another. Clipboard transitions, for example, can take extra milliseconds. I appreciate the "pause until" suggestion for after the "activate" action. I don't use that enough.
The reason I have an "if" action encompassing two pairs of "activate" and "pause" actions, with one pair followed by ⌘N is due to a specific behavior of the Stickies app, which is that when Stickies initially activates (after having not been running), it opens a new sticky note automatically. When that happens, all the macro does is resize and paste the clipboard into that note. But if, when I call the macro, Stickies is already running and there are multiple text-containing stickies floating around, or none at all, a new sticky note needs to be generated, hence the ⌘N action when Stickies is running.
I found that my version did the same… I'm sure you will agree that in a situation in which one of only two chains of events could occur:
A, B, X
A, B, Y
– the only unknown or variable is X
versus Y
. A
followed by B
is a certainty. We know A, B
is true.
If you fancy trying my suggestion, I would be interested to know whether it works for you. If it doesn't, try increasing the nearby Pause
time a little, since, from what you say about your Mac, I would guess that the duplication of Activate Stickies
and Pause
might be slowing things down slightly in your macro and giving the Mac a chance to take another breath.
I find that when I execute your version of the macro when Stickies is not running, I'm getting an extra blank note because as soon as app activates, it automatically opens a new note, and then, since the app is now running, the macro executes the ⌘N, and I get another note, to which the clipboard is pasted. In my version, if the macro is executed when Stickies is not running, the clipboard is pasted into the automatically generated blank note, omitting the ⌘N action.
Thanks for testing. How strange. Am I just missing something obvious or this is a timing peculiarity, I wonder…
I can break your macro (again! ) by moving the Type a Keystroke
action to its own If
action.
That is logically equivalent but in practice, again two notes are opened.
I know you didn't post your macro with the unusual aim of getting someone to break it rather than fix it, but this is curious.
Ha! Well, I think Stickies just has this peculiarity of opening a new note immediately upon activation. Therefore, the first Activate action is actually followed by an invisible ⌘N, making the subsequent ⌘N open a second note!
I got that but but but… Oh, OK, I broke the test for whether Stickies was running in the first place, didn't I!
"Activate" can be seen as sort of having a double meaning: "switch to" and "launch" and although I had that in mind, I didn't think of all the implications.