IanN1990 Posted February 15, 2012 Share Posted February 15, 2012 (edited) could someone help me with some code i am trying to get autoit detect when BBCiplayer is open in Internet Explorer. Opt('WinTitleMatchMode', 2) while 1 sleep(50) if WinGetTitle("[Class:IEFrame]") > "BBC iPlayer - " Then ConsoleWrite("A") EndIf WEnd Kinda works but it does it for any page not just pages with BBC Iplayer in it, any ideas? Edited April 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
water Posted February 15, 2012 Share Posted February 15, 2012 Should be something like:while 1 sleep(50) if Stringleft(WinGetTitle("[Class:IEFrame]"), 14) = "BBC iPlayer - " Then ConsoleWrite("A") EndIf WEnd My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 15, 2012 Moderators Share Posted February 15, 2012 Hi, IanN1990. Is the ">" in your WinGetTitle statement actually in your code, or did you just type that into the forum? Also, I don't see a closing ")" for that statement?? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
IanN1990 Posted February 15, 2012 Author Share Posted February 15, 2012 (edited) Thanks for the answer water and the code i posted is what i was using in the Autoit tool. If i ran it nothing would really happen but if i opened IE and a webpage loaded lots of "A"s would be written. (As my home-page is Iplayer i thought this ment sucess but then found it was doing it for every page". Now using the stringleft it will only run on Iplayer related pages **Edit for Aipion so not to bump Thanks for the idea but as waters code works and doesn't require any extra .au3 i went for that Edited February 17, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
Guest Posted February 15, 2012 Share Posted February 15, 2012 I had a look at the source code of the pages and they seem to have a tag with a ID called "emp-container" which we can use at our advantage of finding if there is a iPlayer. Try this: #include <Inet.au3> $s_URL = "http://www.bbc.co.uk/iplayer/episode/b01by7cs/Mark_Thomas_The_Manifesto_Series_4_Episode_2/" $Has_iPlayer = StringRegExp(_INetGetSource($s_URL ),'emp-container',0) MsgBox(0,"",$Has_iPlayer) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now