Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Fri Dec 15, 2017 6:22 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Beginner Macro: AutoGoogle
Thanked: 1 time(s)  Unread post Posted: Fri Nov 18, 2011 2:58 pm 
VIP Contributor
VIP Contributor
User avatar



Joined: Wed Oct 12, 2011 12:46 am
Posts: 656
Location: Athens
Been thanked: 179 time(s)
Has thanked: 43 time(s)
Contribution Points: 13212
This is a very simple macro I made to help new users get used to working with Blue Eye. It brings up a window in which you type a keyword or phrase. It will then open your browser and google the keyword/phrase for you.

Code:
 begin
     Window.Request user text input("What would you like to google?", "Keyword")
     Variable.Evaluate (Text)("Press OK to begin...", "output")
     Window.Display message box("{output}", "yes")
     Window.Wait for window to disappear("Blue Eye - Input Request", "yes")
     System.Launch application("C:\Program Files\Mozilla Firefox\firefox.exe", "no")
     Macro.Pause("2000")
     Mouse.Click at coordinate("160", "83", "Left")
     Keyboard.Insert text("google.com")
     Keyboard.Press key("{<enter>}")
     Macro.Pause("2000")
     Mouse.Click at coordinate("366", "415", "Left")
     Keyboard.Insert text("{Keyword}")
     Keyboard.Press key("{<enter>}")
     Window.Display message box("Google Search Complete", "no")
     Window. Bring to front("Blue Eye - Message", "yes")
 end
 


Now, copying and pasting this code as it is will not work. There are a few steps you to need to take to customize this code to be usable on your computer.

The first line of this code that needs to be changed is:

Code:
System.Launch application("C:\Program Files\Mozilla Firefox\firefox.exe", "no")


This line launches the browser that you would like to use along with this macro. You need to find the path to the browser you are going to use. Example: "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe"

The path can easily be found by right clicking your browser shortcut and selecting properties.


Image

Now on to the next step. Here are the next two lines of code that need to be changed:

Code:
Mouse.Click at coordinate("160", "83", "Left")


Code:
Mouse.Click at coordinate("366", "415", "Left")


The first line is the coordinates for the URL bar in firefox:

Image

The second line is the coordinates for the search box on google.com:

Image

What we need to do now is find the coordinates that will match your computer. To do this, we will use the Investigator tool. You can access the Investigator either by clicking the magnifying glass(only shows up if the Quotations are empty) next to those lines, or by clicking the tools tab in the BEM(Blue Eye Macro) window:

Image

Once you have opened up the investigator, you're going to need to take a Print Screen. So if you need the coordinates for the firefox URL bar, take a print of firefox open on your computer. Once you have done this, the image will pop up in the investigator. Just click where you want your mouse to click during the AutoGoogle process.

Now that you have your point selected you need to put the X and Y coordinates into the macro. X first, Y second.


Image

If you used the magnifying glass to access the investigator, there will be an "import" button in place of the Coordinate box. This will automatically put the coordinates in the code for you. If you used the tools tab, then you will have to manually put the coordinates in.

Oh look at that, you're almost done! The only thing left to do now is to make sure that the delay in these lines is long enough:

Code:
Macro.Pause("2000")


2000miliseconds = 2 seconds

Depending on the speed of your computer an internet, this may need to be increased. If it is not long enough, the macro will begin the next step before everything has finished loading (Such as Google).

Now you're ready to try it out! Good job, you've made your first few steps towards becoming a BEM Pro
;)

If you have any trouble please post here or PM me :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 3:45 pm 
Silver Contributor
Silver Contributor
User avatar



Joined: Fri Jan 21, 2011 6:28 am
Posts: 110
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 1268
Nice idea :) and congratulations on the lifetime VIP, Xadal.

You could make this macro a little bit easier, I think! When you use
Code:
System.Launch application("", "")
, and a web address is used as the path, it launches the user's default web browser.

So, instead of using the coordinate locations, you could input the user's google search, and append it to this string. "https://www.google.com/search?q=", and therefore a google search will begin, with the user's default browser.

:) mgp.

_________________
alrighty then.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 4:01 pm 
VIP Contributor
VIP Contributor
User avatar



Joined: Wed Oct 12, 2011 12:46 am
Posts: 656
Location: Athens
Been thanked: 179 time(s)
Has thanked: 43 time(s)
Contribution Points: 13212
Thank you mgp :)

Yeah that is a good idea. I just whipped up the code while at work so I didn't have much time to really mess around with it. For the sake of not having to re-write the guide, I may just leave the macro the way it is though :lol:


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 4:29 pm 
Silver Contributor
Silver Contributor
User avatar



Joined: Fri Jan 21, 2011 6:28 am
Posts: 110
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 1268
Sounds like a fine idea. :)

I'm sorry. I didn't realize that it also was also going to be used as a little tutorial.

_________________
alrighty then.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 7:01 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1164 time(s)
Has thanked: 132 time(s)
Contribution Points: 32783
Thank you for the guide :)

Reminds me of this video made by another user: http://www.youtube.com/watch?v=ilSNAay1LfU

In quite an old version of BE I might add.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 7:24 pm 
VIP Contributor
VIP Contributor
User avatar



Joined: Wed Oct 12, 2011 12:46 am
Posts: 656
Location: Athens
Been thanked: 179 time(s)
Has thanked: 43 time(s)
Contribution Points: 13212
Wow, they are VERY similar. Where did you dig that up from? :lol:


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Fri Nov 18, 2011 11:42 pm 
Lifetime VIP Contributor
Lifetime VIP Contributor
User avatar



Joined: Mon Sep 26, 2011 9:38 am
Posts: 1702
Location: Space Australia
Been thanked: 78 time(s)
Has thanked: 6 time(s)
Contribution Points: 9991
Mgp if he was going to just append it to search query there's a lot more work to be done for starters ever noticed that urls cant have spaces so google uses + for a space meaning regex patterns or a fiddly loop.

So this is the google search for "space space"
http://www.google.com.au/search?gcx=w&s ... pace+space
But i we wanted to search for "space space+" it would be
http://www.google.com.au/search?gcx=w&s ... e+space%2B
So we now no that %2B is a plus sign but how many other chars will need conversion.
Its just way too complicated.

_________________
ImageImageImageImage
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Sat Nov 19, 2011 12:01 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1164 time(s)
Has thanked: 132 time(s)
Contribution Points: 32783
Its just a URL encoding, see: http://www.opinionatedgeek.com/dotnet/t ... ncode.aspx

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Sat Nov 19, 2011 12:02 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1164 time(s)
Has thanked: 132 time(s)
Contribution Points: 32783
Xadal wrote:
Wow, they are VERY similar. Where did you dig that up from? :lol:


viewtopic.php?f=111&t=49

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Beginner Macro: AutoGoogle
Thanked: 0 time(s)  Unread post Posted: Sat Nov 19, 2011 4:43 am 
Silver Contributor
Silver Contributor
User avatar



Joined: Fri Jan 21, 2011 6:28 am
Posts: 110
Been thanked: 1 time(s)
Has thanked: 0 time(s)
Contribution Points: 1268
Quote:
Mgp if he was going to just append it to search query there's a lot more work to be done for starters ever noticed that urls cant have spaces so google uses + for a space meaning regex patterns or a fiddly loop.


Correct me if I'm wrong, but I'm pretty certain that this works without anything special.

Code:
 begin
     Window.Request user text input("Google:", "search")
     Variable.Set("google", "https://www.google.com/search?q=")
     Variable.Append text("google", "{search}")
     System.Launch application("{google}", "no")
 end
 

_________________
alrighty then.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group