Jump to content
Macro Express Forums

Clipboard/variable Trap I Fell Into


msiivola

Recommended Posts

Lance Neustaeter revised "Define Word" macro http://www.macros.com/usermacs/umdefineword.htm trims the variable with "Variable Modify String - Trim" which does not help because the later command "Clipboard Paste" uses the untrimmed variable residing in clipboard, not in ME's own variable (I suppose...??). Replacing Clipboard Paste with "Text Type %variable%" pastes the right, trimmed variable.

Link to comment
Share on other sites

First of all, I probably know less about this than anybody, but here's what I discovered.

 

I highlighted some text in notepad and purposefully included some leading and following blank spaces in the highlighted area.

 

The Modify String Variable command has an "Option 2" tab, which allows you to Save to Clipboard or Save to Text File, plus some other options. In this macro, the Option 2 tab shows the Save to Clipboard button selected, leading me to think that the modification would update the information in the clipboard, removing the leading and trailing spaces, leaving only the text that was selected. If this is so, the macro should work as planned.

 

Unfortunately, for me, the Modify String Variable - Trim command either did not "happen" or it was not saved to the clipboard as ordered, because it was sent to the dictionary website with the leading and following blank spaces still there.

 

Fortunately, the MW website did not seem to mind. It ignored these blank spaces and gave a good definition anyway.

 

I'm pretty sure there is something going on here that I don't understand. There usually is.

 

Morgan

Link to comment
Share on other sites

I have modified the original Neustaeter's macro so that now it is possible to grab the word either with mouse or with keyboard. The line, which led me astray by using the untrimmed text from clipboard instead of the trimmed text from variable, is an inactivated line 30 in attached macro, and the "right" way is at line 32. The macro contains explanations (remarks).

Webster_Online_either_via_mouse_or_keyboard.mxe

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