Sign in to follow this  
Followers 0
MarkRobbins

Creeper - A Heads-Up Notification Script

5 posts in this topic

#1 ·  Posted (edited)

Creeper v0.1.1

Creeper is a 'heads up display' notification window that appears at the bottom of the screen and moves to the top and fades away.
It is a window that is semi-transparent, and transparent to clicks.
Creeper is not a UDF, but rather a stand-alone script to be invoked from the command line or another script.
Many notifications can be launched this way in succession without complications.

Pressing right ctrl and left ctrl will remove all notifications from the screen at any time.

Creeper uses an embedded IE object and is thereby capable of rich html-based notifications.

The html framework provided consists of:

  1. An optional title
  2. An optional image
  3. An optional html body (any html you want)

The content parameters are:

  • title
  • html
  • image

Full styling for the framework involves parameters:

  • bordercolor, borderwidth, borderstyle, padding, width
  • backgroundcolor, color
  • font, fontsize
  • titlefont, titlecolor
  • imagewidth, imageheight

Special parameters are:

  • fmtini
  • fmtname
  • outhtml
  • autodel

 

Specifying Command Line Parameters

Specification is made easy by using named parameters, so the command line parameters can look like:
  "name1[,name2]..." "<value for name1>" "<value for name2>"

Parameters for a simple message could look like:
  "title,html" "My Title" "Some html with <b>markup</b>"

To make this even easier, a formatting ini file can be referenced, and parameter values picked up from there:
  "title,html,fmtini,fmtname" "My Title" "Some html with <b>markup</b>" "C:some.ini" "sectionname"

Even more, a registry key can be used for all parameters:
  "2013.07.28.14.37.12.722"

Templating is also supported, so if you have a html value that looks like:
  Hi, my name is %(name)

...then your command line can look like:
  "fmtini,fmtname,title,$name" "C:some.ini" "sectionname" "My Title" "George"

where the html value in this case is picked up from the ini


The other great feature of Creeper is that it can log its messages to a specific point in any html file:
  "html,outhtml" "Log this html" "C:some.html"
 

Next Steps

Examine the code comment header. The file will run without parameters using internal defaults. Let me know if you have any issues or have any solutions to the issues given.

Caveats
  Its v0.1, so read the issues in the comments. The functions do not have thorough documentation headers since this is not a UDF, but the functions are simple and have single line explanations. Also, not a lot of error handling going on at this stage :doh:

History

Edit - Update to v0.1.1

 

TestCreeper.au3
 

Edited by MarkRobbins

Share this post


Link to post
Share on other sites



Here is a screen cap.

post-78716-0-99699400-1375067911_thumb.j

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Instead of hard coding paths such as "C:batchborgTestCreeper.au3", you could use @ScriptDir and @ScriptFullPath. Then people could try it out on their own computers.

http://www.autoitscript.com/autoit3/docs/macros.htm

Also checkout Firefox's function _GuiRoundCorners if you want to make to make your notification boxes have rounded corners:

Edited by robertcollier4

Share this post


Link to post
Share on other sites

Instead of hard coding paths such as "C:batchborgTestCreeper.au3", you could use @ScriptDir and @ScriptFullPath. Then people could try it out on their own computers.

http://www.autoitscript.com/autoit3/docs/macros.htm

Also checkout Firefox's function _GuiRoundCorners if you want to make to make your notification boxes have rounded corners:

Yes, those paths are a bit misleading. They are not referenced unless there is logging going on. They are leftovers from my text-expansion from back in the day when I didn't know about those macros.

Thanks for the tip on round corners, once I get IE to do it in the html, then I can do it with the form, but I still need to get the control placement right, I will probably have to get scrollbar width from SPI in order for IEs scrollbar to be hidden correctly on all machines. All that part is still pretty shaky.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Spask
      By Spask
      Hi, I'm trying to find a text value inside of a html.
      This is what the line looks like normally:
      <p id="line1" class> <span class="bot">TEXT HERE</span> </p> The text then changes to a non breaking space:
      <p id="line1" class> <span class="bot">&nbsp;</span> </p> And then it changes back to normal text but it's different every time.
      Can I code this so that it grabs the text every time it changes and has a variable that represents it?
      I currently have this inside of my loop:
      $span = .document.getElementsByTagName("span") For $text In $span If $text.value = "&nbsp;" Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next The problem is that there are many other lines in the html that have the same span but are called "line3", "line5", etc and the one I need is from "line1".
      I will appreciate if anyone can help with this!
    • electrons
      By electrons
      hi  , hope  you all doing well 
       cant find any elements on the page ?  and the right click mouse dont work too?
      iam trying with more than method , i need help please!!
       

    • ur
      By ur
      I have kept below line to wait for IE to load the site completely and continue.
      _IELoadWait($oIE)
       
      But, the code is continuing without waiting for it and I my execution is failing as the elements are not loaded completely.

       
      Any suggestions for alternate code to wait for the browser to load completely?
       
    • ur
      By ur
      We can select elements in IE using their IDs as below.
      Local $oDiv = _IEGetObjById($oIE, "x-auto-16-input") But to one button in the webpage, there is no ID to it.
      In selenium we have option to select this element using the CssSelector and clicked the button using below code in c# selenium.
      driver.FindElement(By.CssSelector("button.x-btn-text")).Click(); What is the alternative for this in AUtoIT?
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone
      I worked a bit on a little project of mine, and I managed to do what I was trying to do, or, automate a quiz in AutoIt.
      Now, everything works fine but, in order to achieve what I'm trying to achive, I'd like to make this script run faster.
      I'll attach a portion of the code in order to let you understand what my script does.
      $objIE_h1 = _IETagNameGetCollection($objIE, "h1") ; Take the text of the answer If @error Then ConsoleWrite("Errore durante la lettura degli h1 nella pagina. - Errore: " & @error & @CRLF) Else For $objElement In $objIE_h1 $strInnerText = $objElement.innerText Next Select Case StringInStr($strInnerText, "QUESTION") ; Here is the question ; PS4 PRO $objSpans = _IETagNameGetCollection($objIE, "span") ; Answers are stored here For $objElement In $objSpans If $i >= 4 Then $strAnswer = $objElement.innerText ; Take the text of the answer n° 0, 1, 2, 3 If StringInStr($strAnswer, "CORRECT ANSWER") Then ; If I match the correct answer, then, I have to click on the input with answer id = answer_i $j = $i - 4 $objInput = _IEGetObjById($objIE, "answer_" & $j) If @error Then ConsoleWrite("Errore durante la lettura della risposta #" & $i & " - Errore: " & @error & @CRLF) Else _IEAction($objInput, "click") If @error Then ConsoleWrite("Errore durante il click sull'elemento. - Errore: " & @error) Else ConsoleWrite($j & ") Risposta: " & $strAnswer & @CRLF) ExitLoop EndIf EndIf EndIf $i+=1 Else $i+=1 EndIf Next $i = 0 $j = 0 This is what my script does.
      Questions are 20, in which I have 15 multiple choice question, 2 images ( on which I use _IEImgClick() ), and 3 text inputs ( a simple send with the text I have to enter ).
      How can I make all of these, faster?
      If I reach this goal, I've probably done one of my best goals in life, and I'd like to share my happiness with you, giving a huge donation to this fantastic community!
      Thanks for your help