Hey and good day,
After a good while I realized that my KM macro stopped working, the moment I had deleted the other test versions of it. Strange, isn't it?
So everything is fine as long as there are 2 versions, see pic (item5 and 6):
I could not upload the macro for some unknown reason, so here is the pic:
Both 2 macros are in the Global Macro Group, they are almost the same, except 1 relies on the %SystemClipboard%, the other one on the 'temporaryClipboard'.
As long as the 2 macros have the same hot key trigger, they both work.
When 1 of them gets a different hot key trigger, only one of them works.
When 1 of them gets NO hot key trigger at all, the remaining macro will not work.
DISCLAIMER: If we cannot solve this issue, then we can leave it as it is.
(It's weird, and many things are weird, whereas most things are beautiful.)
As @kevinb suggested, if a macro is not doing anything, use the Interactive Help, select Something expected is not happening, and see what it has to say.
So you need to check what the contents of both clipboards are while your macros are running. It would appear that the contents of both clipboards are significant for the running of your (combined!) macro.
If only while testing, perhaps put them both in the same new macro group. That would be firstly for focus of attention, but also, I get the impression (perhaps mistakenly?) that the macros are only needed while BBEdit is the foreground application; if that is the case, limit that new macro group to be available within BBEdit only.
If you can spot another way of doing what you need to (within BBEdit?) then fine, but otherwise, that sequence of steps is not in itself an unusual or inelegant way of doing things in a KM macro.
One of the 2 macros, I set to hot key NONE, and tested the remaining:
Interactive Help - in step 3
Macro Was Triggered
The macro "Add item5 β onequranverse.php (no success when only 1 'Add item')" has fired once.
Since the macro was triggered, you know that it is running the actions. If you are still not getting the results you want, you need to look at the actions you are using. Some common issues you might run in to includeβ¦
Why move the insertion point to the beginning of the document? "Select All" selects everything so your "Insert text by pasting" will overwrite its entire contents, regardless of where the insertion point is.
I did wonder if it was something to do with the file viewer -- but, for me, ββ merely selects the first file in the list.
I've been using the following to check if BBEdit's active pane is the file viewer or the document -- it seems to work OK:
tell application "BBEdit"
set theSelection to (get selection)
if class of theSelection is list and (theSelection is {} or class of item 1 of theSelection is not character) then
return "FileViewer"
else
return "Document"
end if
end tell
Implemented your AScr (this macro is for Opera and FFOX, Safari working fine with old solution "if menu item Paste is not enabled") but now the macro doesn't COPY the bodytext in the blue step 1 "Copy".
Despited adding pauses .
Don't forget (because I always do) that you can reference past clipboards by token -- no need here to save to the variable and delete the current clipboard. So you can delete these actions: