Jump to content
Macro Express Forums

Web Site


Recommended Posts

The help for "Web Site" command says: "Use this command to open a web page. Just enter the web site address and click the OK button. The web site entered is launched when the macro is run. If the browser is not open, the macro also opens the browser."

I use this command launching certain sites using IE. However the browser is already opened (before the macro is activated) but the macro launches the site opening a new window of IE.

Am I missing something?

 

Thanks a lot for any help.

 

Oded.

Link to comment
Share on other sites

This is quite odd!

My default browser is Firefox, for which the Web SIte command works as expected; if Firefox is not running, this command loads Firefox with the requested page. If Firefox is running, this command simply opens a new tab showing the requested page.

But, like you, my experience with IE is quite different. The Web Site command always seems to open a new non-maximized window for IE, even though I have declared my preference for tabs.

So I suggest the following code as a workaround:

Variable Set String %tUrl% to "www.myhq.com"
If Not Program "IEXPLORE.EXE" is running
 Program Launch: "iexplore.exe" (Normal)
Parameters: 
End If
Window Activate: Internet Explorer
Text Type (Simulate Keystrokes): <ALT>d
Delay: 500 milliseconds
Text Type (Simulate Keystrokes): %tUrl%<ENTER>

<VARIABLE SET STRING Option="\x00" Destination="%tUrl%" Value="www.myhq.com" NoEmbeddedVars="FALSE"/>
<IF NOT PROGRAM Option="\x01" Program="IEXPLORE.EXE"/>
<PROGRAM LAUNCH Path="C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/>
<END IF/>
<WINDOW ACTIVATE Title="Internet Explorer" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<TEXT TYPE Action="0" Text="<ALT>d"/>
<DELAY Flags="\x02" Time="500"/>
<TEXT TYPE Action="0" Text="%tUrl%<ENTER>"/>

Link to comment
Share on other sites

This is quite odd!

My default browser is Firefox, for which the Web SIte command works as expected; if Firefox is not running, this command loads Firefox with the requested page. If Firefox is running, this command simply opens a new tab showing the requested page.

But, like you, my experience with IE is quite different. The Web Site command always seems to open a new non-maximized window for IE, even though I have declared my preference for tabs.

So I suggest the following code as a workaround:

Variable Set String %tUrl% to "www.myhq.com"
If Not Program "IEXPLORE.EXE" is running
 Program Launch: "iexplore.exe" (Normal)
Parameters: 
End If
Window Activate: Internet Explorer
Text Type (Simulate Keystrokes): <ALT>d
Delay: 500 milliseconds
Text Type (Simulate Keystrokes): %tUrl%<ENTER>

<VARIABLE SET STRING Option="\x00" Destination="%tUrl%" Value="www.myhq.com" NoEmbeddedVars="FALSE"/>
<IF NOT PROGRAM Option="\x01" Program="IEXPLORE.EXE"/>
<PROGRAM LAUNCH Path="C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/>
<END IF/>
<WINDOW ACTIVATE Title="Internet Explorer" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<TEXT TYPE Action="0" Text="<ALT>d"/>
<DELAY Flags="\x02" Time="500"/>
<TEXT TYPE Action="0" Text="%tUrl%<ENTER>"/>

Paul,

I too like Firefox much more than Ie.

However ME Pro limits the option "wait for the web page" (which I use a lot) only to IE.

I wish Firefox had this option too...

Anyways many thanks for your help.

Much appreciated.

 

Oded.

Link to comment
Share on other sites

However ME Pro limits the option "wait for the web page" (which I use a lot) only to IE.

I wish Firefox had this option too...

While Firefox is still loading a page, you'll notice that there's an X between and below Edit and View in the menu bar that is not greyed out. I've written a macro called FirefoxLoaded that runs after I've requested a specific URL, and returns control only after this X becomes greyed out, OR after a timeout usng some predefined value (in my case, 120 seconds). FirefoxLoaded checks for a specific pixel value in the centre of the X (this pixel value, together with its exact location, varies according to the graphics card and OS you use, but, once set, is stable).

Link to comment
Share on other sites

Check your IE settings. There is one that will cause new external shortcuts to be launched in a new instance. I believe non-tabbed browsing is more efficient so I use this setting all the time.

Link to comment
Share on other sites

Check your IE settings. There is one that will cause new external shortcuts to be launched in a new instance. I believe non-tabbed browsing is more efficient so I use this setting all the time.

Cory,

 

Where exactly can I find the one you are talking about?

Link to comment
Share on other sites

Internet Options > Advanced tab > Reuse windows for launching shortcuts

I have unchecked this setting, restarted computer, but nothing has changed (namely a new IE window is opened every time a macro is run.)

Maybe there is another setting I have to change?

 

Thanks,

 

Oded.

Link to comment
Share on other sites

You want it checked if you want to reuse, not uncheck.

 

Now if you're running in tabbed mode then you should also check your tab browsing settings. Internet Options > General tab > Open Links from other programs in:

 

You just need to look around in the IE settings. Also use the help file.

Link to comment
Share on other sites

You want it checked if you want to reuse, not uncheck.

 

Now if you're running in tabbed mode then you should also check your tab browsing settings. Internet Options > General tab > Open Links from other programs in:

 

You just need to look around in the IE settings. Also use the help file.

Cory, none of these settings makes the slightest difference - I have tried them all.

Link to comment
Share on other sites

Cory, none of these settings makes the slightest difference - I have tried them all.

 

I avoid IE unless FF for some reason can't render a page properly, but there seem to be a few posts about this sort of thing. Here's one that may or may not be relevant:

 

http://blogs.msdn.com/b/askie/archive/2009/03/09/opening-a-new-tab-may-launch-a-new-process-with-internet-explorer-8-0.aspx

 

Oded: Don't let ME pro's lack of a Wait feature force you away from FF! I use a pixel-spotting macro to do the equivalent:

 

<DELAY Flags="\x02" Time="200"/>
<REPEAT UNTIL Variable="%StopColour%" Condition="\x00" Value="13160660" _COMMENT="Grey, after the red during loading. Theme: Default"/>
<GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="94" Y="65" Destination="%StopColour%"/>
<DELAY Flags="\x02" Time="50"/>
<END REPEAT/>
<DELAY Flags="\x01" Time="0.1"/>

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

OK this was bugging me so I enabled tabbed browsing, checked the advanced option to reuse windows, and set the "Open links from other programs in:" > "A new tab in the current window", and created a test macro to launch bluepointdesign.com. It opened in a new tab of the existing window just as I described.

 

W7-64 and IE9

 

Perhaps you have some security software that's causing it not to work properly?

Link to comment
Share on other sites

  • 2 weeks later...

I avoid IE unless FF for some reason can't render a page properly, but there seem to be a few posts about this sort of thing. Here's one that may or may not be relevant:

 

http://blogs.msdn.co...plorer-8-0.aspx

 

Oded: Don't let ME pro's lack of a Wait feature force you away from FF! I use a pixel-spotting macro to do the equivalent:

 

<DELAY Flags="\x02" Time="200"/>
<REPEAT UNTIL Variable="%StopColour%" Condition="\x00" Value="13160660" _COMMENT="Grey, after the red during loading. Theme: Default"/>
<GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="94" Y="65" Destination="%StopColour%"/>
<DELAY Flags="\x02" Time="50"/>
<END REPEAT/>
<DELAY Flags="\x01" Time="0.1"/>

 

--

Terry, East Grinstead, UK

Thank you, Terry :)

Link to comment
Share on other sites

<DELAY Flags="\x02" Time="200"/>
<REPEAT UNTIL Variable="%StopColour%" Condition="\x00" Value="13160660" _COMMENT="Grey, after the red during loading. Theme: Default"/>
<GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="94" Y="65" Destination="%StopColour%"/>
<DELAY Flags="\x02" Time="50"/>
<END REPEAT/>
<DELAY Flags="\x01" Time="0.1"/>

 

Use this code with caution. "Repeat Until <condition>" may cause a freeze if, for some reason, the condition is never met, e.g., another window steals focus. Sometimes it is possible to break out of the loop, and sometimes not.

 

I would avoid using Repeat Until <condition> unless you can include a failsafe mechanism, e.g., a counter that breaks out of the repeat loop after, say, 1000 iterations.

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