Jump to content
Sign in to follow this  
MarkRobbins

Creeper - A Heads-Up Notification Script

Recommended Posts

MarkRobbins

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
robertcollier4

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
MarkRobbins

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  

  • Similar Content

    • SkysLastChance
      By SkysLastChance
      I am having a hard time understanding why this is not working. I was hoping some one could help explain it to me. 
      $tags = $oIE.document.GetElementsByTagName("input") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "fTs-p3298-l0 wplEditControl" Then $target = $tag ExitLoop EndIF Next MsgBox(0,"",$target) If $target = "fTs-p3298-l0 wplEditControl" THEN MsgBox(0,"","itworked") I have tried 
       MsgBox(0,"",$target.Attribute)  MsgBox(0,"",$target.Value)  MsgBox(0,"",$target.InnerText) I would expect to see this in the msgbox
      fTs-p3298-l0 wplEditControl  
    • SkysLastChance
      By SkysLastChance
      I am trying to grab the id "in2xk_26" however it the characters before the underscore always change. (in the name too)
      Is there a way I can find a id or name by the last 3 charcters?
      Using something like "stringright?"
      So I would want to search for just "_26" in this case.
      This is assuming that there are no other _26
       

      #include <Excel.au3> #include <IE.au3> #include <GUIConstantsEx.au3> Global $iMousespeed = 25,$target = "",$TagName = "",$Value = "",$Atrribute = "" $oIE = _IEAttach("MEDITECH") $TagName = "input" $Value = "in2xk_26" $Attribute = "id" $tags = $oIE.document.GetElementsByTagName($TagName) ;TagName ------ MAKE SURE TO NAME THESE For $tag in $tags $class_value = $tag.GetAttribute($Attribute) ;Attribute ------ MAKE SURE TO NAME THESE If string($class_value) = $Value Then ;Value ------ MAKE SURE TO NAME THESE $target = $tag $iScreenX = _IEPropertyGet($target, "screenx") $iScreenY = _IEPropertyGet($target, "screeny") $iWidth = _IEPropertyGet($target, "width") $iHeight = _IEPropertyGet($target, "height") $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed) MouseClick($MOUSE_CLICK_LEFT) ExitLoop EndIf Next  
       
    • SkysLastChance
      By SkysLastChance
      I was wondering how I read data inside of a iframe. I would like to be able to click something inside a iframe. However, I can't even find the tag. 
      The id and name change all the time so I can't use those. 
      The code highlighted in blue is what I am trying to click. (second picture)
      Here is what I have tried.
      $target = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "s_92 altstyle s_93 s_94" Then $target = $tag ConsoleWrite("Tag Found " & $target.outerText&@CRLF) ExitLoop EndIf Next  

       
       

    • SkysLastChance
      By SkysLastChance
       
      WinActivate("MEDITECH - Internet Explorer") Sleep (500) $oIE = _IEAttach("MEDITECH") $oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton") _IEAction($oDiv1, "click") I am just trying to click the little magnifying glass, next to the gear button with no luck. I was hoping someone might have an idea why this is not working?
       

    • SkysLastChance
      By SkysLastChance
      I am trying to type a name in patient summary search box. How should I go about doing this. I am clearly not doing it right. (Attached Picture of HTML code.)
      This is what I have tried. I assume this is not working because it is not a form? 
      WinActivate("MEDITECH - Internet Explorer")       Sleep (500)    $oIE = _IEAttach("MEDITECH")    $oForm = _IEFormGetObjByName($oIE, "systemMenu")    $oText = _IEFormElementGetObjByName($oForm, "sysmenu-searchbarinput") _IEFormElementSetValue($oText, "Hey! This works!")
×