Inserting text by pasting

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!!

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)

@robodean -

And did you try the actions I mentioned - the “Lock Semaphore” actions? I guarantee that if the macro is being launched twice, this will solve the issue.

@robodean, please understand our annoying questions:

You asked for a solution of your problem. @JMichaelTX gave you a solution in form of a different and superior macro. You are content now, your problem is solved.

But we, the people who try to help you, also have an interest: we want to learn why the double pasting (in your original macro) is occurring.