aa2zz6 Posted August 7, 2015 Share Posted August 7, 2015 When I try to run the script nothing happens and the script ends without errors. I think maybe the array is wrong by chance. Func Script1() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is script 1.") Send("!n") EndFunc ;==>Script1 Func Script2() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is script 2.") Send("!n") EndFunc ;==>Script2 Func Script3() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is script 3.") Send("!n") EndFunc ;==>Script3 If $CmdLine[0] = 1 Then Switch $CmdLine[1] Case "/1" Script1() Case "/2" Script2() Case "/3" Script3() EndSwitch EndIf Link to comment Share on other sites More sharing options...
Danyfirex Posted August 7, 2015 Share Posted August 7, 2015 Use WinWaitActive("[CLASS:Notepad]") instead your way.Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
iamtheky Posted August 7, 2015 Share Posted August 7, 2015 (edited) It works fine...(though probably not ideal). just compile it to an exe. and then run it from the command line using the command line parameters you specified. You are certainly welcome to entertain us with the way you thought you were running it. Edited August 7, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Danyfirex Posted August 7, 2015 Share Posted August 7, 2015 I think your problem is that your OS is not English. For me, It does not work. I use Spanish OS. So I use the CLASS Name. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
iamtheky Posted August 7, 2015 Share Posted August 7, 2015 that doesnt even execute notepad on the Spanish OS? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Danyfirex Posted August 7, 2015 Share Posted August 7, 2015 (edited) that doesnt even execute notepad on the Spanish OS?Yes It runs. But does not work this part WinWaitActive("Untitled - Notepad") Send("This is script 2.") Send("!n") @aa2zz6If you want to test in Scite just add your parameters Shift+F8 Saludos Edited August 7, 2015 by Danyfirex Add Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
aa2zz6 Posted August 7, 2015 Author Share Posted August 7, 2015 I tried running it on the script form where you script by pressing F5 but nothing happened. Maybe I'm doing something wrong?Thanks for the replies @ Danyfirex & boththose Link to comment Share on other sites More sharing options...
Danyfirex Posted August 7, 2015 Share Posted August 7, 2015 Did you first add the command line parameter using Shift+F8 ?I should work if you first add the command line parameter. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
aa2zz6 Posted August 8, 2015 Author Share Posted August 8, 2015 I haven't done much with command line parameter and after examining the Help File I don't seem to have a clear understanding. Link to comment Share on other sites More sharing options...
iamtheky Posted August 8, 2015 Share Posted August 8, 2015 (edited) nothing mysterious about them. Just think of command line parameters as parameters for the command line hit - F7open - command promptnavigate to the path and type - WhateverYouNamedThatFile.exe /1 Edited August 8, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
aa2zz6 Posted August 8, 2015 Author Share Posted August 8, 2015 Alright got it! Thank you and I appreciate all the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now