AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Display script execution status on screen

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Sat Nov 24, 2007 10:44 pm    Post subject: Display script execution status on screen Reply with quote

This may or may not be a wish depending on whether or not any good solutions are suggested, but I thought this might be the most befitting forum. I have a few scripts which cycle through all files in a given folder and process them one by one. One script converts all .DWG drawings to .PDF drawings by using DWG TrueView and a PDF printer. The nice thing with this setup is that it's free, and it's proven to be fairly reliable. The other nice thing, is that if it stops, I can manually do whatever step that failed and the script will continue from there. (Many winwaitactive commands). A nice feature for this sort of script, would be to have a sort of status bar, or anything that informs the user what's going on. I think many scripts could benefit from this sort of thing.

The best solution I can think of is to create a function which displays a toolbar tip somewhere on the screen. Something like status("Waiting for a active window: Adobe PDF"). The tooltip would remain in the same position for example in the bottom right of the screen.

Any thoughts?
Back to top
View user's profile Send private message Visit poster's website
tic



Joined: 22 Apr 2007
Posts: 1375

PostPosted: Sun Nov 25, 2007 3:17 am    Post subject: Reply with quote

A simple

Code:
Gui, Add, Progress


would do the trick. Just make the number of files 100% and then divide by 100 to know when to +1 to the progress bar. Also have a text above it that is guicontrolled in a loop to change to the name of the file being worked on
Back to top
View user's profile Send private message
dmatch



Joined: 15 Oct 2007
Posts: 113

PostPosted: Sun Nov 25, 2007 5:21 pm    Post subject: If In Gui Maybe StatusBar? Reply with quote

If you are using (or could use a Gui window) there is a StatusBar Gui control that is described in the help file under "StatusBar controls (GUI)". If not, the Progress Bar idea as suggested by tic seems a good alternative.

dmatch
Back to top
View user's profile Send private message
dmatch



Joined: 15 Oct 2007
Posts: 113

PostPosted: Sun Nov 25, 2007 6:59 pm    Post subject: Put Code Where My Mouth Is Reply with quote

I haven't done much with StatusBar so thought I would see what it had to offer. I did this little prototype to experiment with:
Code:
TestStrings=C:\AFolder\AFile1.ext
,C:\AFolder\Afile2.ext
,C:\AFoldder\Afile3.ext
,C:\AFoldder\Afile4.ext
,C:\AFoldder\Afile5.ext

Paused:=false
Thru:=false

Gui, -0x80000 +border
Gui, Add, Button, Default gPauseIt, &Pause/UnPause
Gui, Add, Button, x+10 gExit, E&xit
Gui, Add, StatusBar, ,Processing
Gui, Show, x100 y100 w210, Testing

Loop, Parse, TestStrings, CSV, %A_Space%
{
   CurrentFile=%A_LoopField%
   Status=Waiting: %A_LoopField%
   SB_SetText(Status)
   sleep, 1000
   Status=Processing: %A_LoopField%
   SB_SetText(Status)
   sleep, 1000
   Status=Finished: %A_LoopField%
   SB_SetText(Status)
   sleep, 1000
}
Status=Finished: All Files Processed
SB_SetText(Status)
Thru:=true
return
   
PauseIt:
   if(Paused){
      Paused:=false
      Pause, Off, 1
      Status:=HoldStatus
      SB_SetText(Status)
   }
   Else{
      Paused:=true
      HoldStatus:=Status
      if(!Thru){
         Status=Paused: %CurrentFile%
      }
      SB_SetText(Status)
      Pause, On, 1
   }
return

Exit:
GuiClose:
   ExitApp

It's a dismal rainy day here. Wink

dmatch
Back to top
View user's profile Send private message
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Sun Nov 25, 2007 10:03 pm    Post subject: Reply with quote

Firstly, thanks for the replies. The progressbar and statusbar of a GUI window was not what I was thinking of, although I understand they were recommended.

My point was having a good and preferably standard way of displaying the status (not progress) of a script. In the example above, my script often waits for the active window to contain some text and I think it should be easy to display what the script is doing somewhere on the screen in a non obtrusive way. I may be wrong, but wouldn't using a GUI window complicate this by interfering with the active window or can it be made to always be on top but never active? If so, then I suppose a GUI window consisting of a progress bar and a status bar would be a good solution.

I was thinking along the lines of using a tooltip, traytip or invisible GUI with text. I suppose it's possible to create a good solution and this should probably have been posted in the Ask for help section. Right now, I'm thinking the traytip might be nice.
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Mon Nov 26, 2007 6:08 pm    Post subject: Reply with quote

be careful, since I found that the traytip tends to steal focus (haven't tried in a while)

Tooltips seem the least intrusive, or the progress or splashimage commands, which are a little more obtrusive, but very controllable.

There is also a script for toaster style popups made in ahk.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Tue Nov 27, 2007 3:40 pm    Post subject: Reply with quote

I found the post for the toaster style popup. Although I couldn't get it to work, it seems a little too advanced for my needs. I think I will stick with the standard tooltip then. Thanks a lot!
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Tue Nov 27, 2007 4:21 pm    Post subject: Reply with quote

did you try either of my posts in that thread? they are both working. The OP did have a bug
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Tue Nov 27, 2007 4:51 pm    Post subject: Reply with quote

I did now and it didn't work, I reinstalled AHK on my machine and now the toaster message popsup and popsaway. It looks very nice and I will surely find some use for this in the future, thanks again.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group