Jump to content
Macro Express Forums

Macro Question


Recommended Posts

Hello,

 

Im new to macro express

 

Is there a way to make so if I have something on my clipboard and I press a key it will pull up google for me and search that term?

 

The search link is below after the = COPY CLIPBOARD HERE then to pull up a browser window with the google results

 

here's the search link http://www.google.com/search?q=

 

Any idea's on how to make this work?

 

thanks:)

Link to comment
Share on other sites

Variable Set String %Clipboard% from the clipboard contents
Variable Modify String %Clipboard%: Trim
Launch Program and Activate Window: Program "FIREFOX.EXE", Parameters ""%Clipboard%"", Window "- Mozilla Firefox"

 

The second line isn't really necessary, but it should make the macro a little more reliable by stripping away leading and trailing spaces.

Link to comment
Share on other sites

Variable Set String %Clipboard% from the clipboard contents
Variable Modify String %Clipboard%: Trim
Launch Program and Activate Window: Program "FIREFOX.EXE", Parameters ""%Clipboard%"", Window "- Mozilla Firefox"

 

The second line isn't really necessary, but it should make the macro a little more reliable by stripping away leading and trailing spaces.

 

Alan: How does that invoke Google Search?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Hi Terry,

 

Google has been my homepage for so long – 12 or 13 years! – that I went on the assumption that the same is true for everybody. Probably not a good assumption…

 

The code that I posted only works if you have set Google as your homepage. (Also, I am using Firefox as my default browser, which may not be true for everybody.)

Link to comment
Share on other sites

Alan,

 

I usually have FF re-open to its previous state, typically with 20-30 tabs open. (Used to be a lot more but I've been trying a 'simplified' work style for a week or so!)

 

And FF is usually (but not always) open anyway. So my amended macro looks like this:

 

Variable Set String %Clipboard% from the clipboard contents

Variable Modify String %Clipboard%: Trim

Activate or Launch: Window "- Mozilla Firefox", Program "firefox.exe", Parameters ""

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

// The following sub-macro tests the pixel colour of the 'X' button at top left of my FF screen, until it changes from red back to grey.

// It will obviously need changing to suit each user.

// And it could be replaced with a simple Delay command, with a time based on trial/error, although that would be less reliable.

Macro Run: Wait for FF web page ready // The text cursor should now be automatically placed in the search box, awaiting entry of a target.

Text Type (Simulate Keystrokes): %Clipboard%

 

--

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