{"id":2451,"date":"2014-08-08T09:43:51","date_gmt":"2014-08-08T09:43:51","guid":{"rendered":"http:\/\/www.mjtnet.com\/blog\/?p=2451"},"modified":"2014-08-08T09:43:51","modified_gmt":"2014-08-08T09:43:51","slug":"detect-which-web-page-ie-is-on-keep-it-simple","status":"publish","type":"post","link":"https:\/\/www.mjtnet.com\/blog\/2014\/08\/08\/detect-which-web-page-ie-is-on-keep-it-simple\/","title":{"rendered":"Detect Which Web Page IE Is On &#8211; Keep It Simple"},"content":{"rendered":"<p>Today we had two different support requests asking how to have a <a href=\"http:\/\/www.mjtnet.com\/macro-scheduler.htm\">Macro Scheduler<\/a> macro determine which page IE is on.  <\/p>\n<p>One person was asking about using Image Recognition for that. You could also use the IE functions to examine the HTML or look for the existence of a specific HTML element. <\/p>\n<p>You could do one of those, sure, but I think that&#8217;s over complicating things.   <\/p>\n<p>My motto is &#8220;keep things simple&#8221;.<\/p>\n<p>IE&#8217;s Window Title adopts the page title of the web page it is displaying.  IE also shows the URL in the address bar.  So why not just look at one of those.  Like this:<\/p>\n<pre class=\"brush:macroscript\">\/\/Two simple methods to see which page IE is at.\r\n\r\n\/\/Method One - Just look at the window title\r\nIfWindowOpen>Bing - Internet Explorer\r\n  \/\/Bing is open - do this\r\nElse\r\n  IfWindowOpen>Google - Internet Explorer\r\n     \/\/Google is open - do that \r\n  Endif\r\nEndif\r\n\r\n\/\/Method Two - Look at the Actual URL in the URL bar - I used the Wizard to get this code and then altered the window title to make it a substring match\r\nUIGetValue>- Internet Explorer*,{\"Address\"},curVals,Positions,nHeight\r\nPosition>google.co.uk,curVals,1,pGoogle\r\nIf>pGoogle>0\r\n  \/\/must be at google\r\nElse\r\n  \/\/must be somewhere else\r\n  Position>bing.com,curVals,1,pBing\r\n  If>pBing>0\r\n    \/\/must be at bing\r\n  Endif\r\nEndif<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Today we had two different support requests asking how to have a Macro Scheduler macro determine which page IE is on. One person was asking about using Image Recognition for that. You could also use the IE functions to examine the HTML or look for the existence of a specific HTML element. You could do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,6],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2451"}],"collection":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/comments?post=2451"}],"version-history":[{"count":4,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2451\/revisions"}],"predecessor-version":[{"id":2455,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/2451\/revisions\/2455"}],"wp:attachment":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/media?parent=2451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/categories?post=2451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/tags?post=2451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}