ne0trace Posted July 25, 2008 Posted July 25, 2008 Hello, I wrote this little piece down here. What I would like to achieve is that the $customer button and the $project button will get combined when I press the $createdir button. But right now the msgbox (for just gives me 78 as an output. In addition I would like to replace every space character with an underscore. I am pretty sure that I misunderstood the whole concept a bit. thank you Felix expandcollapse popup#include <GUIConstantsEx.au3> GUICreate("nerve", 300, 300) GUICtrlCreateLabel("Please select your option. Input might be disabled if needed!", 10, 10) $sapphirebutton = GUICtrlCreateButton ("Activate/Sapphire", 30, 50, 100) $trapcodebutton = GUICtrlCreateButton ("Activate/Trapcode", 180, 50, 100) $wakeonlan = GUICtrlCreateButton ("Start/the/Farm", 105, 90, 100) $customer = GUICtrlCreateInput ("Customer Code", 105, 160) $project = GUICtrlCreateInput ("Project Name", 105, 190, 100) $createdir = GUICtrlCreateButton ("Create Directory", 105, 230, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $sapphirebutton Run ("\\work\administration\scripts_batchdateien\Sapphire_registrieren\plugin_sapphire_aktivieren.exe") ; MsgBox(0, "GUI Event", "You pressed OK!") Case $msg = $trapcodebutton Run ("\\work\administration\scripts_batchdateien\Trapcode_registrieren\Trapcode_registrieren.exe") Case $msg = $wakeonlan Run ("\\work\administration\scripts_batchdateien\FRA_wake_farm.bat") Case $msg = $createdir $path = $customer & $project ; StringReplace ($project, " ", "") MsgBox (4096, "Test", $path) Case $msg = $GUI_EVENT_CLOSE ; MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") ExitLoop EndSelect WEnd
Monamo Posted July 25, 2008 Posted July 25, 2008 (edited) Hello, I wrote this little piece down here. What I would like to achieve is that the $customer button and the $project button will get combined when I press the $createdir button. But right now the msgbox (for just gives me 78 as an output. In addition I would like to replace every space character with an underscore. I am pretty sure that I misunderstood the whole concept a bit. thank you Felix CODE#include <GUIConstantsEx.au3> GUICreate("nerve", 300, 300) GUICtrlCreateLabel("Please select your option. Input might be disabled if needed!", 10, 10) $sapphirebutton = GUICtrlCreateButton ("Activate/Sapphire", 30, 50, 100) $trapcodebutton = GUICtrlCreateButton ("Activate/Trapcode", 180, 50, 100) $wakeonlan = GUICtrlCreateButton ("Start/the/Farm", 105, 90, 100) $customer = GUICtrlCreateInput ("Customer Code", 105, 160) $project = GUICtrlCreateInput ("Project Name", 105, 190, 100) $createdir = GUICtrlCreateButton ("Create Directory", 105, 230, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $sapphirebutton Run ("\\work\administration\scripts_batchdateien\Sapphire_registrieren\plugin_sapphire_aktivieren.exe") ; MsgBox(0, "GUI Event", "You pressed OK!") Case $msg = $trapcodebutton Run ("\\work\administration\scripts_batchdateien\Trapcode_registrieren\Trapcode_registrieren.exe") Case $msg = $wakeonlan Run ("\\work\administration\scripts_batchdateien\FRA_wake_farm.bat") Case $msg = $createdir $path = $customer & $project ; StringReplace ($project, " ", "") MsgBox (4096, "Test", $path) Case $msg = $GUI_EVENT_CLOSE ; MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") ExitLoop EndSelect WEnd Try something along the lines of (untested, so check for typos and such): $path = GuiCtrlRead($customer) & GuiCtrlRead($project) Edit: resized and changed original autoit box to codebox Edited July 25, 2008 by Monamo - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]
ne0trace Posted July 25, 2008 Author Posted July 25, 2008 Woohoo thank you that worked... You might not know what I did wrong with the stringreplace because it simply doesn't do anything? Felix expandcollapse popup#include <GUIConstantsEx.au3> GUICreate("nerve", 300, 300) GUICtrlCreateLabel("Please select your option. Input might be disabled if needed!", 10, 10) $sapphirebutton = GUICtrlCreateButton ("Activate/Sapphire", 30, 50, 100) $trapcodebutton = GUICtrlCreateButton ("Activate/Trapcode", 180, 50, 100) $wakeonlan = GUICtrlCreateButton ("Start/the/Farm", 105, 90, 100) $customer = GUICtrlCreateInput ("Customer Code", 105, 160) $project = GUICtrlCreateInput ("Project Name", 105, 190, 100) $createdir = GUICtrlCreateButton ("Create Directory", 105, 230, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $sapphirebutton Run ("\\work\administration\scripts_batchdateien\Sapphire_registrieren\plugin_sapphire_aktivieren.exe") ; MsgBox(0, "GUI Event", "You pressed OK!") Case $msg = $trapcodebutton Run ("\\work\administration\scripts_batchdateien\Trapcode_registrieren\Trapcode_registrieren.exe") Case $msg = $wakeonlan Run ("\\work\administration\scripts_batchdateien\FRA_wake_farm.bat") Case $msg = $createdir StringReplace ($project, " ", "-") $path = GuiCtrlRead($customer) & GuiCtrlRead($project) MsgBox (4096, "Test", $path) Case $msg = $GUI_EVENT_CLOSE ; MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") ExitLoop EndSelect WEnd
ne0trace Posted July 25, 2008 Author Posted July 25, 2008 Hello, even this slight modification doesn't do the job: expandcollapse popup#include <GUIConstantsEx.au3> GUICreate("nerve", 300, 300) GUICtrlCreateLabel("Please select your option. Input might be disabled if needed!", 10, 10) $sapphirebutton = GUICtrlCreateButton ("Activate/Sapphire", 30, 50, 100) $trapcodebutton = GUICtrlCreateButton ("Activate/Trapcode", 180, 50, 100) $wakeonlan = GUICtrlCreateButton ("Start/the/Farm", 105, 90, 100) $customer = GUICtrlCreateInput ("Customer Code", 105, 160) $project = GUICtrlCreateInput ("Project Name", 105, 190, 100) $createdir = GUICtrlCreateButton ("Create Directory", 105, 230, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $sapphirebutton Run ("\\work\administration\scripts_batchdateien\Sapphire_registrieren\plugin_sapphire_aktivieren.exe") ; MsgBox(0, "GUI Event", "You pressed OK!") Case $msg = $trapcodebutton Run ("\\work\administration\scripts_batchdateien\Trapcode_registrieren\Trapcode_registrieren.exe") Case $msg = $wakeonlan Run ("\\work\administration\scripts_batchdateien\FRA_wake_farm.bat") Case $msg = $createdir $project_nospace = GuiCtrlRead($project) StringReplace ($project_nospace, " ", "-") $path = GuiCtrlRead($customer) & " " & $project_nospace MsgBox (4096, "Test", $path) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Felix
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