 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Murp|e
Joined: 12 Jan 2007 Posts: 261 Location: Norway
|
Posted: Sat Nov 24, 2007 10:44 pm Post subject: Display script execution status on screen |
|
|
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 |
|
 |
tic
Joined: 22 Apr 2007 Posts: 1375
|
Posted: Sun Nov 25, 2007 3:17 am Post subject: |
|
|
A simple
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 |
|
 |
dmatch
Joined: 15 Oct 2007 Posts: 113
|
Posted: Sun Nov 25, 2007 5:21 pm Post subject: If In Gui Maybe StatusBar? |
|
|
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 |
|
 |
dmatch
Joined: 15 Oct 2007 Posts: 113
|
Posted: Sun Nov 25, 2007 6:59 pm Post subject: Put Code Where My Mouth Is |
|
|
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.
dmatch |
|
| Back to top |
|
 |
Murp|e
Joined: 12 Jan 2007 Posts: 261 Location: Norway
|
Posted: Sun Nov 25, 2007 10:03 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Mon Nov 26, 2007 6:08 pm Post subject: |
|
|
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 |
|
 |
Murp|e
Joined: 12 Jan 2007 Posts: 261 Location: Norway
|
Posted: Tue Nov 27, 2007 3:40 pm Post subject: |
|
|
| 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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Tue Nov 27, 2007 4:21 pm Post subject: |
|
|
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 |
|
 |
Murp|e
Joined: 12 Jan 2007 Posts: 261 Location: Norway
|
Posted: Tue Nov 27, 2007 4:51 pm Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|