Jump to content
Macro Express Forums

Clipboard commands don't work with Shortkeys?


terrypin

Recommended Posts

Several times in the last few months I've had straightforward macros that fail because they don't capture text to the clipboard. I now think I've found the cause. Each of these macros had Shortkeys assigned. For example, I would assign 'm1' and type '##m1' to run the macro. If I change the activation to Hotkeys, they work correctly. Change back to (any) shortkey, and it fails again.

 

I have latest version 3.7.2.1, but the same problem occurred in previous version. Is this a known bug? Is there anything I can do to work around it please? As it stands, it effectively means Shortkey activation can't be used whenever text is being saved to the clipboard, which is something I do a lot.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Several times in the last few months I've had straightforward macros that fail because they don't capture text to the clipboard. I now think I've found the cause. Each of these macros had Shortkeys assigned. For example, I would assign 'm1' and type '##m1' to run the macro. If I change the activation to Hotkeys, they work correctly. Change back to (any) shortkey, and it fails again.

I wrote this simple macro:

Variable Set String %T1% "This is some text"
Variable Modify String: Save %T1% to Clipboard

First I assigned a hotkey to run it, pressed the hotkey, and it ran as expected.

Then I removed the hotkey and assigned a shortkey of qq (where my shortkey combination is ;;); this also ran perfectly every time

 

One caveat: I use Clipmate as by clipboard handler; I don't know whether this has any bearing.

Link to comment
Share on other sites

Thanks for your interest and help. Your macro worked fine for me too, but it's not quite equivalent to my problem macro, which I have still not been able to get working.

 

My original macro is scoped to a program called Memory-Map. It clicks the mouse in a text box and copies its data to the clipboard and thence to T1. Unlike your example, mine sets the variable from the clipboard, i.e.

Variable Set String %T1% from Clipboard

which may be significant.

 

To continue the discussion, I've now modified the macro to make it more accessible to others. It now works on a filename in a Windows folder, and should copy the name to the clipboard.

 

// Assumes the mouse is on an already highlighted filename in a Windows folder
// L-click to make it editable. (I could have used F2 instead, but this keeps it like the original.)
Keystroke Speed: 50 Milliseconds
Mouse Speed: 5 Milliseconds
Mouse Left Button Click
Delay 1 Seconds
Text Type: <CONTROL>c<ESC>
Delay 500 Milliseconds
// Put name in string variable T1
Variable Set String %T1% from Clipboard
Macro Return

 

<REM2:Assumes the mouse is on an already highlighted filename in a Windows folder><REM2:L-click to make it editable. (I could have used F2 instead, but this keeps it like the original.)><SPKEY:0050><SPMSE:00005><LCLK><DELAY:1><TEXTTYPE:<CONTROL>c<ESC>><MSD:500><REM2:Put name in string variable T1><TVAR2:01:03:><MRETURN>

 

With shortcut key activation, this fails. The clipboard does not get updated. (And, in my case, inexplicably the chosen Windows folder closes and the My Computer folder opens!) With a hotkey, it works fine.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Is it a timing issue? What type of clipboard operation are you doing? Can you post a simple example for me to try? Maybe make it a simple demonstration using notepad or something.

 

Thanks Cory. See the example included in my reply to Paul.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I could have used F2 instead, but this keeps it like the original.

How ironic! It's the left click that fails (for me, at any rate)!

 

I inserted a Macro Return immediately after the mouse click. Running the macro any which way you like always resulted in the filename being highlighted momentarily (but not in Edit mode as far as I could see), followed immediately by the Explorer window losing Focus.

 

Replacing the mouse click with a Text Type of F2 gets the macro working. Then I removed my Macro Return statement, and assigned a shortkey. And it works as expected.

Link to comment
Share on other sites

How ironic! It's the left click that fails (for me, at any rate)!

 

I inserted a Macro Return immediately after the mouse click. Running the macro any which way you like always resulted in the filename being highlighted momentarily (but not in Edit mode as far as I could see), followed immediately by the Explorer window losing Focus.

 

Replacing the mouse click with a Text Type of F2 gets the macro working. Then I removed my Macro Return statement, and assigned a shortkey. And it works as expected.

 

Very strange! And it gets stranger, because now I am getting nothing when I run the macro with a shortkey. Not just a failure at some point, but no activation at all. Changed the shortkey several times (xy, zz9, etc) but no change. Yet still works fine with a hotkey. I tried Restore Keyboard Hooks and Restore Mouse Hooks, and closed/re-started Mem-Map, but still the same problem. Other simple 'text typing' macros still work OK with their shortkeys, so I'm baffled.

 

Returning to your test, are you saying that the initial left click failed to get into edit mode even with activation by a hotkey? If so, that's a different (but puzzling!) issue. If it just fails with a shortkey then, coupled with my new symptoms this morning, it seems further evidence that shortkey activation gives inconsistent and unrepeatable behaviour...

:|

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Well, at least I'm back to yesterday's behaviour now, after rebooting my PC.

 

I've followed your example and now have this ultra-simple macro, for use on any selected filename in a Windows folder.

 

Mouse Left Button Click

Delay 500 Milliseconds

Macro Return

 

<LCLK><MSD:500><MRETURN>

 

As before, with any shortkey it fails. It somehow goes 'up the tree' so that the result displayed is My Computer or sometimes the Desktop folder. With any hotkey it does what it should. Namely opens the filename for editing/copying.

 

This is different to the result you get, yes?

 

It would be helpful if a few others could run it. Maybe the result is OS dependent or something? Or depends on your astrological star sign?

:)

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I've followed your example and now have this ultra-simple macro, for use on any selected filename in a Windows folder.

 

Mouse Left Button Click

Delay 500 Milliseconds

Macro Return

 

<LCLK><MSD:500><MRETURN>

 

As before, with any shortkey it fails. It somehow goes 'up the tree' so that the result displayed is My Computer or sometimes the Desktop folder. With any hotkey it does what it should. Namely opens the filename for editing/copying.

Please try what I suggested, by replacing the first line with a Text Type F2 command, and see if that cures the problem.

Link to comment
Share on other sites

I don't really understand this.

- You've presented a problem you're experiencing.

- I've suggested a solution.

 

But now you say you can't implement the solution (for reasons that are not clear to me). If it is indeed your left-click command that is causing the problem (certainly the case for me), then continuing to use code that contains this left-click statement will continue not to work. How then can you ever hope to solve your problem?

Link to comment
Share on other sites

I don't really understand this.

- You've presented a problem you're experiencing.

- I've suggested a solution.

 

But now you say you can't implement the solution (for reasons that are not clear to me). If it is indeed your left-click command that is causing the problem (certainly the case for me), then continuing to use code that contains this left-click statement will continue not to work. How then can you ever hope to solve your problem?

 

Eh? I don't think you can have properly read this thread from the outset! In particular, my post of Nov 26 2007, 05:20 PM included:

Thanks for your interest and help. Your macro worked fine for me too, but it's not quite equivalent to my problem macro, which I have still not been able to get working.

and, in the code itself:

// L-click to make it editable. (I could have used F2 instead, but this keeps it like the original.)

 

I've reminded you of these points a couple of times since! So I'm baffled why you're finding it hard to understand. It's very simple. Your 'solution' (of using F2 instead of a left-click) is not applicable to the original macro that prompted this thread. F2 cannot be used in that box in Memory-Map.

 

Our discussion on the ultra-simple macro was to find an answer to the underlying issue, namely: do macros sometimes work fine with hotkey activation and fail with shortkey activation? You are the only user who has so far tested this and your answer as I understand your feedback is plainly Yes. (However, a so far unexplained side issue arose because in your case your macro failed to get into edit mode even with activation by a hotkey. Like my original, my ultra-simple macro works fine with a hotkey.)

 

So:

1) I am still looking for a solution to my specific problem.

2) I'm still hoping to get some MEX Support response on the underlying issue of unreliable shortkey activation.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I am not encountering any problems with either way (mouse or F2). Both work fine for me.

 

Now, it doesn't work when the Do Not Remove Keystrokes Typed checkbox is not checked. Without checking the box, you are telling Macro Express to backspace over what you just typed. And what happens when you backspace in Windows Explorer? You climb the folder tree, possibly all the way up to your desktop.

Link to comment
Share on other sites

I am not encountering any problems with either way (mouse or F2). Both work fine for me.

 

Now, it doesn't work when the Do Not Remove Keystrokes Typed checkbox is not checked. Without checking the box, you are telling Macro Express to backspace over what you just typed. And what happens when you backspace in Windows Explorer? You climb the folder tree, possibly all the way up to your desktop.

 

Thanks Joe, good of you to take the trouble to try it.

 

And yes, bingo, you've put your finger on the cause of my problem! I just came back here to post the good news that I'd had a very fast reply from Insight Software, making exactly the same point about that Do Not Remove Keystrokes Typed setting, and saw your post. Mine has always been unchecked, and I never thought to change it.

 

I'm confident my other more complex macros will respond to the same technique too. I'll try it tomorrow.

 

Really pleased to sort this - it's been vexing me for days!

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...