DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA? simple startup manager with timer  (Read 12,562 times)

dbarton

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 51
IDEA? simple startup manager with timer
« on: March 22, 2008, 12:27 AM »
Basically I want to boot up, and have a window to ask if I want to run my IM cleint and a couple of other things that normally load.

If I don't answer in a few seconds, they will load by default.  If I say No, it will complete without these loaded..




{EDIT:} mods, did I post this in the wrong area?
« Last Edit: March 22, 2008, 12:56 AM by dbarton »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: IDEA? simple startup manager with timer
« Reply #1 on: March 22, 2008, 01:46 AM »
you posted in the right place.. could be a useful idea too.

might be nice though to be able to provide a list of programs and then configure for each one whether after the timeout it will run by default or not run by default.

so on startup the user would be presented with a list of programs (maybe with a checkbox next to each one that was either checked or unchecked based on configuration), and then an OK button.  If no action is taken then it will timeout after a few seconds and run the checked programs.

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA? simple startup manager with timer
« Reply #2 on: March 22, 2008, 12:40 PM »
Basically I want to boot up, and have a window to ask if I want to run my IM cleint and a couple of other things that normally load.

If I don't answer in a few seconds, they will load by default.  If I say No, it will complete without these loaded..
Startup Delayer comes very close: http://www.donationcoder.com/forum/index.php?topic=1399.0
Thank you.

dbarton

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 51
Re: IDEA? simple startup manager with timer
« Reply #3 on: March 22, 2008, 07:12 PM »

I just had a look at startup delayer, and doesn''t seem like it's meant for this, but I appreciate the tip..

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA? simple startup manager with timer
« Reply #4 on: March 22, 2008, 08:32 PM »
:) Try AskToRun!

It shows a timed confirmation dialog before running programs.
Edit the apps= line to add programs, separate them by commas.
You can also change the timer= to change the countdown time.

To change the default action, just change the defaulttext, othertext, defaultaction and otheraction lines.

Edited 2008.03.23

Skrommel

Code
;AskToRun.ahk
; Shows a timed confirmation dialog before running programs.
; Edit the apps= line to add programs, separate them by commas.
; Edit the timer= line to change the countdown time.
; To change the default action, edit the lines
;  defaulttext and othertext and defaultaction and otheraction.
;Skrommel @ 2008

apps=Notepad.exe,Calc.exe ; Programs to run, separated by commas
timer=10                  ; Seconds to wait before default action
defaulttext=No            ; Text displayed on the default button
othertext=Yes             ; Text displayed on the other button
defaultaction=DONT        ; DO or DONT
otheraction=DO            ; DO or DONT
prompt=Run these apps?    ; Text displayed in the dialog
seconds=sec               ; Text displayed after the counter

#NoEnv
#SingleInstance,Force

applicationname=AskToRun

StringReplace,apps,apps,`,,`n,All
Gui,+ToolWindow +AlwaysOnTop
Gui,Add,Text,,`n%prompt%`n`n%apps%`n
Gui,Add,Button,w75 Default Vcounter G%defaultaction%,&%defaulttext% (%timer% %seconds%)
Gui,Add,Button,w75 x+5 G%otheraction%,&%othertext%
Gui,Show,,%applicationname%
SetTimer,COUNTDOWN,1000
Return


COUNTDOWN:
timer-=1
GuiControl,,counter,&%defaulttext% (%timer% %seconds%)
If timer=0
  Goto,DONT
Return


DO:
SetTimer,COUNTDOWN,Off
Loop,Parse,Apps,`n
  Run,%A_LoopField%,,UseErrorLevel
ExitApp


GuiClose:
DONT:
SetTimer,COUNTDOWN,Off
ExitApp
« Last Edit: March 23, 2008, 01:34 AM by skrommel »

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
Re: IDEA? simple startup manager with timer
« Reply #5 on: March 22, 2008, 08:38 PM »
skrommel for the rescue!  ;D
Thank you.

yksyks

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 476
Re: IDEA? simple startup manager with timer
« Reply #6 on: March 22, 2008, 09:02 PM »
I just had a look at startup delayer, and doesn''t seem like it's meant for this, but I appreciate the tip..

It does exactly what you need (and more), just enable the Advanced mode.

dbarton

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 51
Re: IDEA? simple startup manager with timer
« Reply #7 on: March 23, 2008, 12:08 AM »
very cool!!!

and is there an easy change for default to be "no"?
not as easy as changing ..


If timer=0
  Goto,YES
Return

to say

If timer=0
  Goto,NO
Return

kinda, but countdown indicator is now wrong, and the code is a bit confusing to this AHK newbie.
« Last Edit: March 23, 2008, 12:39 AM by dbarton »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA? simple startup manager with timer
« Reply #8 on: March 23, 2008, 01:35 AM »
:) Try the updated script above!

Skrommel

dbarton

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 51
Re: IDEA? simple startup manager with timer
« Reply #9 on: March 23, 2008, 01:45 AM »
Now that's cool!

I kinda learned AHK overnight, and banged something together that works, so now I'm torn, but this is very cool. I'll use mine on one machine and yours on the other :)

I called mine BootBoy.

Original address: https://www.donationcoder.com/forum/index.php?topic=12743.0