Sign in to follow this  
Followers 0
jbarr

Small App: App_auto_launch

26 posts in this topic

Hi!

I've been lurking around the forums for a while, and finally decided to throw together a simple "auto-launcher" application that I thought I would share if anyone else would find it useful. I'm sorry if this type of app has already been posted, but I didn't find one, so I just wrote my own.

Every morning, I log onto my computer and go through the boring routine of launching the same 5 or so applications. They are the "core" apps that I need running throughout the day. Though it really isn't that tough to launch them, I wanted a "one-click" solution, so AutoIT did the trick.

The app can be found here

Basically, I defined an ".ini" file that has a section defining the number of applications to launch and then sections for each application that defines what and how to launch it. Note: You will have to tailor this .ini file to your needs. It will NOT run as-is because you most likely don't have the same apps loaded!

The program reads this .ini file and just plugs in the values and launches the apps. It even looks to see if the app's process is already running to prevent duplicate launches.

It's certainly not rocket science, but it does makes morning startup simpler and quicker.

So, let me know what you think...suggestions are most welcome!

-Jim


Visit Jim's Tips for lots of cool tips on Gmail, SageTV, PDA's, and whatever else interests me!

Share this post


Link to post
Share on other sites



cool, this falls under the catagory of "I'm too lazy to do myself"... very cool... I've now got my own five apps in the ini, and it's really handy to have the "check running" part there.

Thanks!


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

or Opera.... www.opera.com

Share this post


Link to post
Share on other sites

Maxthon (IE2) http://www.maxthon.com/en/index.htm

IE with alota features like Opera. :(

Putting a gecko engine also, like Firefox engine?

Fully compatible with other apps, which I like.

Oh, nice app btw. :ph34r:

Share this post


Link to post
Share on other sites

I also use myie2 (maxthon).


Who else would I be?

Share this post


Link to post
Share on other sites

In other words... STOP USING STANDARD IEXPLORE! It is the worst.

Share this post


Link to post
Share on other sites

Such harsh words.

I.E. may be basic but it does the basic task.

MS only supplies the basics so we can choose alternatives.

MS would lose out if they customized too much.

Then we would have to switch to something like linux for better choice?

Share this post


Link to post
Share on other sites

I think very few of us switched from IE for new features. Most of us switched because of the security holes in IE.

Share this post


Link to post
Share on other sites

I think very few of us switched from IE for new features.  Most of us switched because of the security holes in IE.

<{POST_SNAPBACK}>

Bah, I've been an avid Netscape/ Mozilla user since the day's of Netscape Navigator 4.x and Netscape Communicator

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

I'm looking forward to the day when one of the others becomes the dominant browser and then all the hax0rs start picking holes in that and we all realise that all software is insecure :ph34r:

I dimly remember a lecture at Uni that had a mathmatical proof that all software contains bugs. Scary stuff.

Share this post


Link to post
Share on other sites

I'm sure there are, but I'm willing to bet that M$'s closed source code has a lot more bugs than an open CVS for Firefox :ph34r:


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

I'm sure there are, but I'm willing to bet that M$'s closed source code has a lot more bugs than an open CVS for Firefox :ph34r:

<{POST_SNAPBACK}>

Just because it's open source doesn't mean there won't be bugs or security issues. What it does mean, though, is that any bugs or security issues will be fixed in a much more timely manner than waiting around for a Microsoft update.

Share this post


Link to post
Share on other sites

Did you people forget about the topic here?

:ph34r:

:(

Man, these smilies are cool...

Oh... nice app, jbarr.

:lol:

Share this post


Link to post
Share on other sites

Thanks guys! I used to program these types of things all the time using Wilson WindowWare's WinBatch, but since I'm at a new company, the WinBatch Compiler is no longer available to me, and I really can't justify spending the $500.00 for it for myself. So, AutoIT really fits the bill. It simply shines and is so simple!

Oh, and as far as IE goes, I would prefer to use an alternative, but it's the "corporate standard" here, so it's what I use. Obvioiusly, there are inherent issues with IE, but for what we use it for, it's safe and secure enough.


Visit Jim's Tips for lots of cool tips on Gmail, SageTV, PDA's, and whatever else interests me!

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

that's funny, I found autoit because I had seen WinBatch at a trade show and was looking for something like it but free.

I thought I'd try to make it so I could have the script launch apps in a chosen state, but it's not working right... don't have a clue why. I just added $state to the functions and replaced @SW_MAXIMIZE with it... don't see why that wouldn't work...

;App_Auto_Launch.au3
;
;Written by: Jim Barr
;Email: jim+au3@barr.net
;Web Site: http://jimstips.com
;
;DESCRIPTION
;This application simply reads an initialization file to launch a pre-defined set of applications
;It reads as input the file "App_Auto_Launch.ini". The first section defines the number of apps to
;launch. Each successive section contains the required launch information for each app.
;
;COMMENTS
;I wrote this app to take the tedium out of launching the same apps every day whan I log in.
;Please feel free to tailor it to your needs, however if you sell any derivitive versions of this, 
;please just give me credit. Thanks!
;
;----------------------------------------------------------------------------------------------------
AutoItSetOption("TrayIconDebug", 1)
$title = "App Auto-launch"
;Read in number of apps to launch
$appcount = IniRead("App_Auto_Launch.ini", "NumberApps", "AppCount", "No Apps Defined")
;
;Define and display initial Splash Text
$splashtext = "Auto-Launching " & $appcount & " applications..."
$wd = 300
$ht = 20 + 20 * $appcount
SplashTextOn($title, $splashtext, $wd, $ht)
Sleep(2000)
;
;Read in app definitions and launch the apps
For $i = 1 To $appcount
   $checkrunning = IniRead("App_Auto_Launch.ini", "App" & $i, "CheckRunning", "Y")
   $processname = IniRead("App_Auto_Launch.ini", "App" & $i, "ProcessName", "NotDefined")
   $description = IniRead("App_Auto_Launch.ini", "App" & $i, "Description", "NotDefined")
   $programname = IniRead("App_Auto_Launch.ini", "App" & $i, "ProgramName", "NotDefined")
   $startupdirectory = IniRead("App_Auto_Launch.ini", "App" & $i, "StartupDirectory", "NotDefined")
   $delay = IniRead("App_Auto_Launch.ini", "App" & $i, "Delay", "2000")
   $state = IniRead("App_auto_launch.ini", "App" & $i, "State", "@SW_MINIMIZE")
   Launchit($checkrunning, $processname, $programname, $description, $startupdirectory, $delay, $state)
Next
;
;Function to check if process is running
;----------------------------------------------------------------------------------------------------
Func Launchit($checkrunning, $processname, $programname, $description, $startupdirectory, $delay, $state)
   If $checkrunning = "Y" Then
      If Not ProcessExists($processname) Then
         LaunchProgram($programname, $description, $startupdirectory, $delay, $state)
      Else
         $splashtext = $splashtext & @CRLF & $description & " is already running..."
         SplashTextOn($title, $splashtext, $wd, $ht)
         Sleep($delay)
      EndIf
   Else
      LaunchProgram($programname, $description, $startupdirectory, $delay, $state)
   EndIf
EndFunc  ;==>Launchit 
;
;Function to launch the apps
;----------------------------------------------------------------------------------------------------
Func LaunchProgram($programname, $description, $startupdirectory, $delay, $state)
   $splashtext = $splashtext & @CRLF & "Starting " & $description & "..."
   SplashTextOn($title, $splashtext, $wd, $ht)
   Run($programname, $startupdirectory, $state)
   Sleep($delay)
EndFunc  ;==>LaunchProgram
;
Exit

Edit: Also changed $ht to work off of the number of $appcount so more if listing more apps the splashbox will expand.

and here's the modified ini:

[NumberApps]
AppCount=5
[App1]
CheckRunning = "Y"
ProcessName = "aruser.exe"
Description = "Remedy"
ProgramName = "C:\Program Files\Remedy\Aruser.exe"
StartupDirectory = "C:\Program Files\Remedy"
Delay = 1000
State = @SW_MINIMIZE
[App2]
CheckRunning = "Y"
ProcessName = "SCiTE.exe"
Description = "SciTE"
ProgramName = "C:\Program Files\AutoIt3\SciTe\SciTE.exe"
StartupDirectory = ""
Delay = 1000
State = @SW_MINIMIZE
[App3]
CheckRunning = "Y"
ProcessName = "firefox.exe"
ProgramName = "C:\Program Files\Mozilla Firefox\firefox.exe"
Description = "Mozilla Firefox"
StartupDirectory = ""
Delay = 1000
State = @SW_MINIMIZE
[App4]
CheckRunning = "Y"
ProcessName = "winamp.exe"
ProgramName = "C:\Program Files\Winamp\winamp.exe"
Description = "Winamp"
StartupDirectory = ""
Delay = 1000
State = @SW_MINIMIZE
[App5]
CheckRunning = "Y"
ProcessName = "outlook.exe"
Description = "Outlook"
ProgramName = "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"  /recycle
StartupDirectory = ""
Delay = 3000
State = @SW_MINIMIZE



#~ State options:
#~ @SW_HIDE  Hides the window and activates another window.  
#~ @SW_MAXIMIZE  Maximizes the specified window.  
#~ @SW_MINIMIZE  Minimizes the specified window and activates the next top-level window in the Z order.
Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

The reason is the "@SW_MINIMIZE" is a string so actually is 0.

these are the values for the different modes:

SW_HIDE = 0

SW_NORMAL = 1

SW_MAXIMIZE = 3

SW_MINIMIZE = 6

Try replacing it with these values.....

Edit: typo's

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

The reason is the "@SW_MINIMIZE" is a string so actually is 0.

these are the values for the different modes:

SW_HIDE = 0

SW_NORMAL = 1

SW_MAXIMIZE = 3

SW_MINIMIZE = 6

Try replacing it with these values.....

Edit: typo's

<{POST_SNAPBACK}>

so, Autoit doesn't recognize the @ macros when presented in a value? I get it

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

so, Autoit doesn't recognize the @ macros when presented in a value?  I get it

<{POST_SNAPBACK}>

Well its like this: you store the string @SW_MINIMIZE into a variable.

Then use the variable as parameter. in your case the var $state has the value of 0 which would launch everything with @SW_HIDE value..

just run this to show what i mean:

$state = "@SW_MINIMIZE"

msgbox(0,'test1',Number($state))

msgbox(0,'test2',NUMBER(@SW_MINIMIZE))

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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