MerkurAlex Posted July 7, 2007 Share Posted July 7, 2007 (edited) Here is the code expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AForm1", 633, 454, 193, 115) $scriptbox = GUICtrlCreateEdit("", 8, 8, 609, 417) $MenuItem1 = GUICtrlCreateMenu("File") $open = GUICtrlCreateMenuItem("Open", $MenuItem1) $sva = GUICtrlCreateMenuItem("Save as", $MenuItem1) $exit = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("Tools") $run = GUICtrlCreateMenuItem("Run", $MenuItem5) $compile = GUICtrlCreateMenuItem("Compile", $MenuItem5) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $curfile="" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $exit exit case $sva $flnam=FileSaveDialog("Save as", @scriptdir,"default(*.uam)",16,".uam") $flopen=fileopen($flnam,2) filewrite($flopen,guictrlread($scriptbox)) fileclose($flopen) case $run if $curfile="" then msgbox("","","No file opened or file not saved file must be saved to run.") else run("Autoit3.exe " & $curfile) EndIf case $open $curfile=fileopendialog("Open file",@scriptdir,"default(*.uam)") $opfl=fileopen($curfile,0) $filer=fileread($opfl) fileclose($opfl) guictrlsetdata($scriptbox,$filer) EndSwitch WEnd i get this error Line 0 (File "C:\new"): Error: Error opening the file. im kinda tired so for some reason i cannot figure out why btw i get this error trying to run a file ohh crap so tired i posted in the wrong forum can someone move this please? Edited July 7, 2007 by EagleClaw [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
eckyecky Posted July 7, 2007 Share Posted July 7, 2007 (edited) tryexpandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AForm1", 633, 454, 193, 115) $scriptbox = GUICtrlCreateEdit("", 8, 8, 609, 417) $MenuItem1 = GUICtrlCreateMenu("File") $open = GUICtrlCreateMenuItem("Open", $MenuItem1) $sva = GUICtrlCreateMenuItem("Save as", $MenuItem1) $exit = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("Tools") $run = GUICtrlCreateMenuItem("Run", $MenuItem5) $compile = GUICtrlCreateMenuItem("Compile", $MenuItem5) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $curfile="" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $exit exit case $sva $flnam=FileSaveDialog("Save as", @scriptdir,"default(*.uam)",16,".uam") $flopen=fileopen($flnam,2) filewrite($flopen,guictrlread($scriptbox)) fileclose($flopen) case $run if $curfile="" then msgbox("","","No file opened or file not saved file must be saved to run.") else run("Autoit3.exe """ & $curfile&"""") EndIf case $open $curfile=fileopendialog("Open file",@scriptdir,"default(*.uam)") $opfl=fileopen($curfile,0) $filer=fileread($opfl) fileclose($opfl) guictrlsetdata($scriptbox,$filer) EndSwitch WEndin the run line you need to have quotes around the scriptrun("Autoit3.exe """ & $curfile&"""") Edited July 7, 2007 by eckyecky 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