Drakthor Posted June 16, 2009 Share Posted June 16, 2009 Greetings! I am re-releasing my file handler in AutoIt instead of its current Batch platform due to the user-friendly GUI. I have run into an error when attempting to process files I need. I have 3 input boxes (Source Image, Source Archive, Output) and 3 variables respectively derived from FileOpenDialog, FileOpenDialog, FileSaveDialog. When you hit the fourth button it should execute a DOS command to copy the two input files into the output and delete the source depending on whether or not a Checkbox is ticked. My code snippet: Case $Button4 _RunDOS(copy /b $inputi + $inputa $inputo) If GUICtrlRead($Checkbox1) == 1 Then _RunDOS(del $inputi) _RunDOS(del $inputa) EndIf My error: Line 66 (File "D:\Documents and Settings\Administrator\Desktop\test.au3 _RunDOS(copy /b $inputi + $inputa $inputo _RunDOS(^ERROR Error:Error parsing function call. Link to comment Share on other sites More sharing options...
DCCD Posted June 16, 2009 Share Posted June 16, 2009 Something's Missing! "" + & [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 16, 2009 Share Posted June 16, 2009 My error:Do you read help-file before using this function? And also read about strings, datatypes, and operators (under «Language Reference» in the help file). Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Drakthor Posted June 16, 2009 Author Share Posted June 16, 2009 Something's Missing! "" + &Ok I've placed the quotes Case $Button4 _RunDOS("copy /b $inputi + $inputa $inputo") If GUICtrlRead($Checkbox1) == 1 Then _RunDOS("del $inputi") _RunDOS("del $inputa") EndIf I'm clueless where to place the other symbols... Sorry I'm a bit of a AutoIt noobie :\ Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 16, 2009 Share Posted June 16, 2009 I'm a bit of a AutoIt noobieThis reason is not good enough to ignore and not read the help-file... Case $Button4 _RunDOS("copy /b " & $inputi & $inputa & $inputo) If GUICtrlRead($Checkbox1) == 1 Then _RunDOS("del " & $inputi) _RunDOS("del " & $inputa) EndIf Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Drakthor Posted June 16, 2009 Author Share Posted June 16, 2009 (edited) This reason is not good enough to ignore and not read the help-file... Case $Button4 _RunDOS("copy /b " & $inputi & $inputa & $inputo) If GUICtrlRead($Checkbox1) == 1 Then _RunDOS("del " & $inputi) _RunDOS("del " & $inputa) EndIfTried it before. Didn't work. Copy and pasted just to make sure and no error is thrown however, it does nothing. This is the original command: copy /b & %var1% + %var2% %var3% del %var1% del %var2% Edited June 16, 2009 by thejay2012 Link to comment Share on other sites More sharing options...
martin Posted June 16, 2009 Share Posted June 16, 2009 Tried it before. Didn't work. Copy and pasted just to make sure and no error is thrown however, it does nothing. This is the original command: copy /b & %var1% + %var2% %var3% del %var1% del %var2% Instead of RunDOS in your code, use ConsoleWrite. Then you can see what the string actually looks like and I think you will quickly see what's wrong. When you get it as you want it then you can use the string construction in RunDOS. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Drakthor Posted June 17, 2009 Author Share Posted June 17, 2009 I've decided to heck with the annoying batch commands. Is there any identical AutoIt command to combine files. I'll give an example: The batch was the following-> copy example_image.jpg + example_archive.zip example_output_image.jpg The example_output_image.jpg in this case appeared to be an image and opened like an image of example_image.jpg but when you renamed the extension from .jpg to .zip the example_archive.zip and all of its contents were uncorrupted (as was the image). That is my main workaround from batch that I need for this program. A name of a command would be most helpful here Link to comment Share on other sites More sharing options...
BrettF Posted June 17, 2009 Share Posted June 17, 2009 You have not tried to even read the help file. I seriously doubt you have even tried Martin's suggestion. Personally I think a batch file will be easier for you, because right now, you have no hope of even making it work, how do you expect to do something harder? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
MrCreatoR Posted June 17, 2009 Share Posted June 17, 2009 he batch was the following->_RunDOS("copy example_image.jpg + example_archive.zip example_output_image.jpg") And for your first example: Case $Button4 _RunDOS("copy /b " & $inputi & " + " & $inputa & " " & $inputo) If GUICtrlRead($Checkbox1) == 1 Then ;_RunDOS("del " & $inputi) ;_RunDOS("del " & $inputa) FileDelete($inputi) FileDelete($inputa) EndIf Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team 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