Inserting text by pasting

Have a simple macro to paste in some text.
But each time, it pastes the text twice. Which is bad.
I am using this marco to open a specific nuke script:

Type the ⌘W Keystroke (close current script)
Type the ⌘O Keystroke (open new script)
Type the ⌘A Keystroke (select the existing path in the dialogue box)
Type the Delete Keystroke (delete it)
Insert Text ‘/Volumes/vault-01/vfx/collectible tracking/nuke/co…’ by Pasting (insert the full path an name of the script)
Type the Enter Keystroke (enter)

the result is that KM pastes the text twice and the open naturally fails.
VERY confused.

LOL.

What you describe should work, as far as I can tell. Can you post the actual actions? Something sounds fishy.

Although paste should work, I prefer to use “Insert by Typing” for cases like this. You can also add a RETURN at the end of the string, so you wouldn’t need the “Type ENTER Keystroke”.

1 Like

Insert typing also results in the same duplicated path.
It’s very odd…

Please post your macro. I have used this technique many times, and if setup properly it will work.

trying to figure out how to do that!
stand by!

next.kmmacros (3.8 KB)

I don’t see anything wrong in the macro.

Maybe the trigger is the problem. You have a device trigger with Keypad 0. And you have a Keystroke ⌘A action in the macro. The key code for “A” is 0.

So — maybe — this is interfering with the key from your device and the macro gets triggered twice.

I also don't see anything obviously wrong, but sometimes timing can be a problem. So, you might start by adding a Pause after each of the key actions:

This is probably excessive, but the first step is to get the macro working correctly. Then you can try reducing/eliminating some of the Pauses.


If your intent is to open a specified file, then this macro will get the job done, and is simpler and more robust:

<img src="/uploads/default/original/2X/a/ac9b96ac02fabbfeae5e11b9a477bf7021755dea.png" width="444" height="129">

If the file extension is not the default for your app, then you will need to change "Default Application" to your app.

You can fix the issue of the macro being triggered more than once by adding a "Semaphore Lock" action at the start of the macro, like this:

  • Set the timeout to 1 hundredths of a second.
  • Turn off "Notify after timeout

...and add this to end of the macro:

If the problem really is a multiple triggering because of the device Keypad 0 trigger and the keystroke ⌘A action, then it should also work if you explicitly exclude the modifiers from the trigger:

(do not select any of the modifier key icons)

Well that worked, Instantly!!
WOW.

thanks so much

Thank you so much to everyone for their help and suggestions.
Who said the internet was a dark swamp filled with trolls?
Well. It is, but thank you just the same!

LOL. We try really hard to make sure this place isn’t like that. Thanks for appreciating it!

That’s good to hear.
Which one worked, with the Pauses, or with the Open File?

If one of the above posts solves your problem/question as originally stated, please check the “Solved” checkbox at the bottom of the post. Here’s my post.

Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.

Open File.
I had already tried using pauses on my own without success.

1 Like

So the mystery of the double-paste remains unsolved.

Would you mind to try your original macro with a different device key trigger (e.g. keypad 1 instead of 0) ?

(I’m just curious to know if my weird speculation about the conflict between ⌘A and the key pad 0 trigger was right…)

Well here’s the thing. I had already tried placing long pauses when trying to debug. The step where I use cmd A works perfectly. I even used break points. When it gets to the paste step, the break point actually shows two paste steps even though there is only one.

Happy to record a screen cast. What’s the best way to share such a thing ?

Personally, I use YouTube. If you don’t have an account, just create one - it’s free.

There are other options, of course, but that’s what I use.

Yes, my (weird) theory was that the ⌘A action triggers a second macro launch. (See above.) This would still be consistent with your observation (“The step where I use cmd A works perfectly”).

So, did you try it with a different trigger? (e.g. keypad 1)