Jump to content

jhinesyo

Active Members
  • Posts

    24
  • Joined

  • Last visited

jhinesyo's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. ; Shows the filenames of all files in the current directory $search = FileFindFirstFile("c:\temp\*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) ;; run your command here WEnd ; Close the search handle FileClose($search)
  2. worked like a charm! thanks much! Jeff
  3. I wrote a small script for a few end users- it is a menu that launches programs for them. I used a Radio button control next to each app they launch. When they single click, everything works great.... When they double click... oh why do they double click.... things get jumbled up I have been poking around for a solution to my problem. Any ideas how to have autoit only accept a single click on the radio button? If they double click, tripple, etc... the extra clicks are ignored for a few moments? My autoit gui looks for the radio button selections through a While / Case / Select / Wend statement. Hope this explains enough, and here is a little code to help show what I mean ... While 1 $msg = GuiGetMsg() Select Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED ;application BlockInput(0) launch($appname) ... ;a few more $msg for diff apps here ... Case $msg = $GUI_EVENT_CLOSE BlockInput(0) SplashOff() _Exiter() EndSelect Wend thanks! Jeff
  4. thanks! I will be able to finally learn this stuff... take care, Jeff
  5. Works! Thanks!! Is there anything I can read up on to show me the proper Quote order for the Run Command? Basic Runs are fine, but the command line level are terribly confusing to me! thanks WeaponX!
  6. Hello AutoITers, I grab a file from an HTTPS server and store it locally on the machine running my script. Then I would like the 7zip command line to extract it. My typical problem is that I cant seem to get the RunWait coded properly to execute the 7zip command point it at the zip file and have it unzip to a folder.... RunWait("7za.exe e -o " & @DesktopDir & "\My Folder" & " " & @DesktopDir & "\My Folder\archive.zip", "",@sw_hide) the proper command line for 7Zip is: 7za e -o "OUTPUT DIRECTORY" "PATH TO ZIP INCL FileName" my output directory is: @DesktopDir & "\My Folder" ( desktop of current user, folder called My Folder ) Zip is located in: @DesktopDir & "\My Folder\archive.zip" ( desktop of current user, folder called My Folder ) I cannot seem to get this working and I know that the issue is in my RunWait command... Usually just a quote/single quote issue but I can for the life of me get this to work! thanks! Jeff
  7. Hi SmOke_N, I just found this code example that might suit my needs: $Form 1 = GuiCreate(...) .. .. launch function to child gui() ... ... Func ChildGui() $Form2 = GuiCreate(.....) ... gui 2 stuff .... GUISetState(@SW_ENABLE,$Form1) GUIDelete($Form2) EndFunc If the above code does not fit the bill, I will be posting my code shortly after, thanks!
  8. Problem: I have a main auto it script w/ GUI code. When I launch a function to create an additional GUI window- with other functions, the new GUI window appears and runs as it should, however, when I click the X to close the 2nd GUI window, the whole program terminates- not just the "child" gui window. Is there some code I should be using to spawn this additional child GUI window and close it without affecting my main program? I looked through some example code, but I haven't seen anything that matches my specific problem. thanks!
  9. Can you use this code example: http://www.autoitscript.com/forum/index.php?showtopic=41655
  10. Hello All, I have an issue with an application time out screen popping up. I would like to have the AutoIT gui I wrote put in the username/password and click OK for the user. My current GUI when launched collects the username/password for the application in question. The user then clicks a radio button on my GUI app which installs / launches the application, waits for the login screen and enters in the username / password. Once in the application, my Autoit GUI just sits in the background- waiting for input I assume. I would like to have the GUI scan for the application time out window that pops up and asks the user to re-login. It is a java program, so no chance in seeing any window text, other than the Title Bar. Fortunately, it seems to be a pretty unique title, "Please re-authenticate to continue" is the title, and the Auto it window tool see's that, but no controls, or other window text. How can I have the Autoit GUI that is running send the username/password again? thanks!!!
  11. Well, I may have found my own answer- I knew I shouldn't have posted so quick Down, in the return section of the function, I commented out this line, and the array now returns with the appropriate \ within it. I will leave this post so this may help the next "fast poster" ;$szReturn = StringReplace($szReturn,'\', '') as always, thanks!
  12. Hello All, I've been reviewing this excellent Recursive Search code found here: hxxp://www.autoitscript.com/forum/index.php?showtopic=42049 For some reason, when I get the array back, it has stripped out the '\' within the full path + file name. So instead of d:\myfolder\mysubfolder\myfile.txt I get d:myfoldermysubfoldermyfile.txt is there anyway for me to get back that critical \ in the path, I want to take this array, open these files and edit them one by one with the full path. thanks! CODE #cs ---------------------------------------------------------------------------- Syntax: File_Search($szRoot, [$Szmask = "*.*"[, $nFlag = 1[, $nOcc = 0]]]) Parameters: $szRoot = the folder to start searching from $Szmask = The file mask (Default *.* returns all) $nFlag (Optional) Default is 7 Can be added as follows 1 = Recursive Search 2 = Path and Filename 4 = Sorted array $nOcc (Optional) - 1 = Return only the first matching file, anything else = Return all matching files (Default) Requirements: Array.au3 for _ArraySort function Return Values: On Success - Returns an array of the file names On Failure - Returns 0 Modifications: Changed return value to an array Now excepts an array or a '|' separated list to use multiple file masks Accepts flags to return full path and/or sort the array Note If sorting is not used then you do not have to #include array.au3 Example: $var = _FileSearch("C:\", "*.vbs|*.js") will return a sorted array of all the vbs and js files (including path) on C:\ drive #ce ---------------------------------------------------------------------------- #include <Array.au3> ;Variables Dim $dirArray[1] $pathdata = "D:\myfolder\mysubfolder\" $filename = "myfile.txt" Func _FileSearch($szRoot, $Szmask = "*.*", $nFlag = 7, $nOcc = 0) Local $hArray = $Szmask, $iRec, $iPath, $iSort Switch $nFlag Case 1 $iRec = 1 $iPath = 0 $iSort = 0 Case 2 $iRec = 0 $iPath = 1 $iSort = 0 Case 3 $iRec = 1 $iPath = 1 $iSort = 0 Case 4 $iRec = 0 $iPath = 0 $iSort = 1 Case 5 $iRec = 1 $iPath = 0 $iSort = 1 Case 6 $iRec = 0 $iPath = 1 $iSort = 1 Case Else $iRec = 1 $iPath = 1 $iSort = 1 EndSwitch If NOT IsArray($hArray) Then $hArray = StringSplit($hArray, '|') Local $Hfile = 0, $F_List = '' $szBuffer = "" $szReturn = "" $szPathlist = "*" For $I = 1 To Ubound($hArray)-1 $szMask = $hArray[$I] If NOT StringInStr ($Szmask, "\") Then $szRoot &= '' Else $iTrim = StringInStr ($Szmask, "\",0,-1) $szRoot &= StringLeft ($Szmask, $iTrim) $Szmask = StringTrimLeft ($Szmask, $iTrim) EndIf If $iRec = 0 Then $Hfile = FileFindFirstFile ($szRoot & $szMask) If $Hfile >= 0 Then $szBuffer = FileFindNextFile ($Hfile) While NOT @Error If $iPath = 1 Then $szReturn &= $szRoot If $szBuffer <> "." AND $szBuffer <> ".." Then $szReturn &= $szBuffer & "*" $szBuffer = FileFindNextFile ($Hfile) Wend FileClose ($Hfile) EndIf Else While 1 $Hfile = FileFindFirstFile ($szRoot & "*.*") If $Hfile >= 0 Then $szBuffer = FileFindNextFile ($Hfile) While NOT @Error If $szBuffer <> "." AND $szBuffer <> ".." AND StringInStr (FileGetAttrib ($szRoot & $szBuffer), "D") Then _ $szPathlist &= $szRoot & $szBuffer & "*" $szBuffer = FileFindNextFile ($Hfile) Wend FileClose ($Hfile) EndIf If StringInStr ($szReturn, $Szmask) > 0 AND $nOcc = 1 Then $szRoot = '' ExitLoop EndIf $Hfile = FileFindFirstFile ($szRoot & $szMask) If $Hfile >= 0 Then $szBuffer = FileFindNextFile ($Hfile) While NOT @Error If $iPath = 1 Then $szReturn &= $szRoot If $szBuffer <> "." AND $szBuffer <> ".." Then $szReturn &= $szBuffer & "*" $szBuffer = FileFindNextFile ($Hfile) Wend FileClose ($Hfile) EndIf If $szPathlist == "*" Then ExitLoop $szPathlist = StringTrimLeft ($szPathlist, 1) $szRoot = StringLeft ($szPathlist, StringInStr ($szPathlist, "*") - 1) & "\" $szPathlist = StringTrimLeft ($szPathlist, StringInStr ($szPathlist, "*") - 1) Wend EndIf Next If $szReturn = "" Then Return 0 Else $szReturn = StringReplace($szReturn,'\', '') $F_List = StringSplit (StringTrimRight ($szReturn, 1), "*") If $iSort = 1 Then _ArraySort($F_List) Return $F_List EndIf EndFunc ;<===> _FileSearch() $DirArray = _FileSearch($pathdata, $filename, 3) _ArrayDisplay($DirArray, "Files Located In....") thanks!
  13. Thanks ResNullius, that ControlClick command works great.
  14. Thanks BigDod! Exactly what I was looking for. Code works likes a charm now.
  15. I have a front end to an application that captures your password once and everytime the login screen of a certain application pops up to the forground, this Autoit will fill in the user id and password. The GUI is working, but, I would like for the users to be able to hit "Enter" as a valid option when they are done filling out user / password boxes. How can I do this? here is my code below: CODE #include <GuiConstants.au3> $username = "" $password = "" $id_user = "" $id_pass = "" GuiCreate("Single-Sign On", 429, 292) GUICtrlCreatePic (c:\anyimage,jpg, 10, 10, 411, 100) GUICtrlSetState(-1, $GUI_DISABLE) GUISetBkColor (0xCCCCCC) ; will change background color GUICtrlCreateLabel ("Application Single-Sign On", 120, 120, 200) GUICtrlCreateLabel ("Username:", 10, 163, 60) GUICtrlCreateLabel ("Password:", 10, 193, 60) $id_user = GUICtrlCreateInput ("", 80, 160, 200, 20) $id_pass = GUICtrlCreateInput ("", 80, 190, 200, 20, $ES_PASSWORD) $btn = GUICtrlCreateButton ("Login", 40, 250, 60, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $btn $username = GUICtrlRead($id_user, 1) $password = GUICtrlRead($id_pass, 1) GUISetState(@SW_HIDE) ;hide when user/pass are grabbed exitloop Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
×
×
  • Create New...