Sign in to follow this  
Followers 0
brunospfc

Help to create a sequence of Programs!

8 posts in this topic

Hello Everyone!

I'm new with AutoIT and I really need your help people! :D

I need to do a project for a company that I work and using AutoIT. The idea appear to be simple, but I'm not having sucess! Here it's, I need to put a sequence of programs to run, like in Sysmark 2007 Preview and if it's possible generate a score in the end.

Can someone help me? :oops:

Thank you in advance! :rip:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What do you have written so far?

There are not many ppl that are willing to do the work for you. However if after attempting to write you own script, and still having problems, many here will be willing to help point you in the right direction.

If your looking to just automate a bunch of applications then 2 functions come to mind.

Run() ;which will execute an application and return immediately to the next line of your code.

RunWait() ;which will execute an application and wait until it finishes before returning to the next line of your code.

create a file or ini file that has a list of these applications you wish to run, read them in individually or into an array, and with a loop you could use RunWait or Run to execute each one. Creating the list in a File will allow you to add or subtract applications to be run at later dates.

Good Luck, and post again if run accross any problems.

Edit: Some other functions that could assist your task:

IniRead ;reads a single ini value

IniReadSection ;reads an entire ini section

_FileReadToArray() ;reads a file creating each line into a seperate value

For...Next ; A loop

Do...Until ; another loop

While...Wend ; another loop option.

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

What do you have written so far?

There are not many ppl that are willing to do the work for you. However if after attempting to write you own script, and still having problems, many here will be willing to help point you in the right direction.

If your looking to just automate a bunch of applications then 2 functions come to mind.

Run() ;which will execute an application and return immediately to the next line of your code.

RunWait() ;which will execute an application and wait until it finishes before returning to the next line of your code.

create a file or ini file that has a list of these applications you wish to run, read them in individually or into an array, and with a loop you could use RunWait or Run to execute each one. Creating the list in a File will allow you to add or subtract applications to be run at later dates.

Good Luck, and post again if run accross any problems.

Edit: Some other functions that could assist your task:

IniRead ;reads a single ini value

IniReadSection ;reads an entire ini section

_FileReadToArray() ;reads a file creating each line into a seperate value

For...Next ; A loop

Do...Until ; another loop

While...Wend ; another loop option.

Thank you for your help! The truth is that I'm not so good in programming, but I've got to learn because of this project that I have to present in the company that I work for!

I'm using the SciTE editor to do the scripts, but I just need an exemple of a script to do this, for exemple. Open Microsoft Word and run a file, then after a time open Microsoft Excel, and after a time open Windows Media Player and run a music file, after the music ends, open the Internet Explorer and enter in any website and close.

This kind of sequence, and having this script, I could edit in the future for other programs.

Can you help me?

Thank you!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

How I see it is you've already received some good advice from Realm to get you on your way, but what you're looking for now is someone to create the script on your behalf. How the forum works is you try to create some code and if you get stuck then you ask a question, of course we expect you to search for the problem beforehand as 90% of the time the question has been asked and answered.

I take it you're aware of the proverb 'Give someone a fish and you feed him for a day..,' therefore providing a full working example to someone with limited knowledge of the syntax won't help you learn. I appreciate this is for your job & is probably critical to your future within the company, so if you don't want to learn/try then may I suggest you (or you company) look at employing a programmer to do it for you. Have fun and good luck.

NOT a full working Example:

#cs
    Create an INI file like this and call it Run.ini:
    [Run]
    1=Word.exe
    2=Something.exe ; etc etc...
#ce

#include <array.au3>

Local $aSection = IniReadSection("Run.ini", "Run")
For $A = 1 To $aSection[0][0]
    $aSection[$A][0] = $aSection[$A][1]
    $aSection[$A][1] = Run($aSection[$A][1]) ; Returns a PID.
    Sleep(2000) ; Wait 2 seconds.
Next
_ArrayDisplay($aSection)
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

How I see it is you've already received some good advice from Realm to get you on your way, but what you're looking for now is someone to create the script on your behalf. How the forum works is you try to create some code and if you get stuck then you ask a question, of course we expect you to search for the problem beforehand as 90% of the time the question has been asked and answered.

I take it you're aware of the proverb 'Give someone a fish and you feed him for a day..,' therefore providing a full working example to someone with limited knowledge of the syntax won't help you learn. I appreciate this is for your job & is probably critical to your future within the company, so if you don't want to learn/try then may I suggest you (or you company) look at employing a programmer to do it for you. Have fun and good luck.

NOT a full working Example:

#cs
    Create an INI file like this and call it Run.ini:
    [Run]
    1=Word.exe
    2=Something.exe ; etc etc...
#ce

#include <array.au3>

Local $aSection = IniReadSection("Run.ini", "Run")
For $A = 1 To $aSection[0][0]
    $aSection[$A][0] = $aSection[$A][1]
    $aSection[$A][1] = Run($aSection[$A][1]) ; Returns a PID.
    Sleep(2000) ; Wait 2 seconds.
Next
_ArrayDisplay($aSection)

Thank you for the information.

I don't want anyone to do it for me, sorry if I meant that! Like when anybody is learning something by the books, for exemple, you got to learn using the exemples of the book, right? I think this is the path for anything in life, the worst ideia it's for someone do it something for you, when you need to learn!

But like everything in life, we need to make the first step with help and knowledge!

Thank you one more time!

Share this post


Link to post
Share on other sites

Good to hear. The example I posted above will give you a head start into achieving your goal of running a series of applications.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Good to hear. The example I posted above will give you a head start into achieving your goal of running a series of applications.

Thank you my friend! Thank you very much!

I'll do it a script and put it here, for you to see what I did! And I want your opinion! :D

Share this post


Link to post
Share on other sites

..you got to learn using the exemples of the book..

There are working examples for every native AutoIt function in the Help file.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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