Jump to content
Macro Express Forums

Spurious text entry


Recommended Posts

A section of my macro looks like this (a self contained demo so that others can run it):

 

// Open Google Advanced Search web page

Web Site, "http://www.google.co.uk/advanced_search", using Default Web Browser

Delay: 1 seconds

// Tab to the domain box.

Keystroke Speed: 1 milliseconds

Text Type (Simulate Keystrokes): <TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB> // Tab to 'site or domain' box.

Delay: 0.5 seconds

Text Type (Simulate Keystrokes): http://support2.magi...p?showforum=113 // Enter domain. (Example here is ME Pro Forum.)

 

 

But instead of the correct URL

http://support2.magi...p?showforum=113

 

various errors are being made, such as these successive examples, which are without the Keystroke Speed command :

 

htptp:/:///support2.magix.net/boards/magix/index.php?showforum=113

http:P//://support2.magix.net/boards/magix/index.php?showforum=113

http://p://support2.magix.net/boards/magix/index.php?showforum=113

http:?:///support2.magix.net/boards/magix/index.php?showforum=113

 

With the Keystroke Speed command then the error is as follows, still wrong no matter how absurdly large I make the keystroke delay but consistent from 2ms upwards!

 

http://://support2.m...p?showforum=113 (1 ms)

 

http://p://support2....p?showforum=113 (2 ms)

http://p://support2....p?showforum=113 (5 ms)

http://p://support2....p?showforum=113 (10 ms)

http://p://support2....p?showforum=113 (25 ms)

http://p://support2....p?showforum=113 (50ms)

http://p://support2....p?showforum=113 (100 ms)

 

(I didn't want those to display as links, but not iimediately sure how to avoid it.)

 

Anyone have any thoughts on the cause please, and how to fix it?

 

--

Terry, East Grinstead, UK

TestErrorProblem.mex

Link to comment
Share on other sites

Well, a short time after posting, I found a fix for that specific demo.

 

Change the mode of the TextType command to Use Clipboard and Paste Text

 

But in the real macro I'm using a variable %tDomain%, so that doesn't help me!

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

The "Use Clipboard and Paste Text" command places the specified text on the clipboard, and pastes it.

 

You can still use the command, even if you want to preserve the clipboard, although there are limits!

 

The following works if the clipboard contains unformatted text. If you have formatted text on the clipboard, the formatting will be lost, e.g., italics, underline etc. This code definitely doesn't work if you have an image in the clipboard.

 

// Preserve the clipboard
Variable Set String %Clip% from the clipboard contents

// Output the domain name via the clipboard
Text Type (Use Clipboard and Paste Text): %tDomain%

// Empty and restore the clipboard
Clipboard Empty
Clipboard Start Copy
 Text Type (Simulate Keystrokes): %Clip%
Clipboard End Copy

Link to comment
Share on other sites

Thanks all.

 

But the seegar goes to you, Cory, many thanks! Good call, it was indeed something very close to your suggestion.

 

Took me a while to isolate though. I first made an MXE of the test macro, closed ME Pro, and ran the MXE. But the issue was still present, so none of my hundreds of macros was to blame. (First time I've ever used that method of eliminating ME Pro. Is that the 'standard' technique?)

 

I've long since uninstalled Stiletto (mainly because of this sort of problem) so the only other thing I could think of was my small collection of Autohotkey (AHK) scripts. I made these during an intensive effort to learn AHK early last year, most of which I've now forgotten. One of them was a set of 'Hotstrings' (essentially like ME Pro's Shortkeys). And one of the many entries in that was:

 

:*:htt::http://

 

I added it (and scores more) in the flush of my first enthusiasm, and like 95% of them I've not used it once. It lets me type 'htt' and immediately converts that to 'http://'. Small wonder the macro was having trouble!

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

  • 1 month later...

Hi, you could save yourself a lot of trouble and make your script more reliable by launching an Google advanced search URL instead of trying to type in stuff. For instance, here is the direct URL to search for the word "transition" in the site that you listed.

 

https://www.google.com/search?as_q=transition&as_qdr=all&as_sitesearch=http%3A%2F%2Fsupport2.magix.net%2Fboards%2Fmagix%2Findex.php%3Fshowforum%3D113&as_occt=any&safe=images

 

Most of it looks like gobbledegook, but it is quite straightforward. All the stuff after /search? are search parameters and each parameter is separated by an ampersand (&). as_q= is the search word and as_sitesearch= is the domain. You could surf the links below to find out exactly what they mean, but you usually don't need to. Here's what you could do:

1. Do a search with the Google advanced search page as you normally would.

2. Copy the resulting URL from your web browser. It'll be a long URL.

3. In a text editor, remove any parameters that are blank, e.g. &as_rights=

4. The URL can now be launched by MEP, saved as a bookmark, etc. It'll take you directly to the search results without the need to type in search strings.

 

More info:

 

Google Search URL Parameters – Query String Anatomy

http://www.blueglass...string-anatomy/

Scroll down to Google “Advanced Search” URL Parameters

Link to comment
Share on other sites

Thanks, but as explained in my original post, that was just a small section of my full macro, which works fine now that I've fixed it as described earlier.

 

It allows easy searching of a dozen or so of my frequently used forums, starting from a multiple choice command.

 

--

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