am632
Active Members-
Posts
235 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
am632's Achievements
Polymath (5/7)
3
Reputation
-
Add quotes around file names after Drag & Drop
am632 replied to am632's topic in AutoIt General Help and Support
Hi Guys, Thanks for your suggestions, The second solution worked with a minor modification. Local $String = StringReplace (_ArrayToString($__aGUIDropFiles, "|", 1),"|",'" "') This now formats as follows which is exactly what I needed. "File 1.txt" "File 2 - copy.jpg" Many Thanks -
Hi Everyone, I'm using the following script to get files via drag & drop which which works fine, I'm just having the file names display in a msgbox at the moment as they will be passed to another command-line program later. #NoTrayIcon #include <GUIConstantsEx.au3> #include <GuiConstants.au3> #include <FileConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIEx.au3> #include <Array.au3> #include <String.au3> ;Global Declaration Global $aDrop_List, $__aGUIDropFiles, $dropFile, $Main $Main = GUICreate("Main", 400, 400, -1, -1, $WS_POPUP, $WS_EX_ACCEPTFILES) GUISetBkColor(0x8a64e7, $Main) GUICtrlCreateLabel("Drop files here", 45, 11, 240, 23, -1, -1) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI") GUICtrlSetColor(-1, "0xFFFFFF") GUICtrlSetBkColor(-1, "-2") Local Const $iDrop = GUICtrlCreatePic("Image\image.jpg", 100, 60, 100, 100, -1, -1) GUICtrlSetState($iDrop, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW, $Main) GUIRegisterMsg($WM_DROPFILES, 'WM_DROPFILES') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_DROPPED _DropFunc() EndSwitch WEnd #endregion Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $lParam Switch $iMsg Case $WM_DROPFILES Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam) If UBound($aReturn) Then $__aGUIDropFiles = $aReturn Else Local Const $aError[1] = [0] $__aGUIDropFiles = $aError EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc Func _DropFunc() Local $String = _ArrayToString($__aGUIDropFiles, " ", 1, UBound($__aGUIDropFiles) - 1) msgbox(0,"",$String) EndFunc The problem is the command line program I'm using doesn't support spaces in the file names so can anyone help me wrap each file name in quotes once they have been dropped in, or after the _ArrayToString function I think would work. I'm not even sure where to start with fixing this, The only thing I thought was to add quotes before and after the $string variable in the msgbox but this can only work if 1 file has been dropped in and not multiple files which is what I require. Any help would be greatly appreciated. Many Thanks
-
postCucumber reacted to a post in a topic:
get computer make & model help?
-
WinAppDriver, Appium, Selenuim - C#, .Net & Java are your solution to my AutoIt question? Well I got all the help I needed here so don't bother replying back 'cos you clearly can't add any additional value to your helpful answer.
-
If IUIAutomation is the only way to do this in AutoIt without needing 3rd party software then thanks for providing this, I'll have a look at it. But all your other list really has nothing to do with AutoIt. I appreciate your help but your original reply came across as a bit rude which you have since edited. Thanks for pointing me in the direction of IUIAutomation though.
-
I looked at the Chrome UDF but when I saw it said it requires an additional chrome extension and host application I stopped reading. My question was Is there another way to do this? I don't want to use additional 3rd party tools so if this can't be done in AutoIt in a similar way to _IE functions - without additional software or extensions then I'll just use iMacros.
-
Earthshine reacted to a post in a topic:
Embed & automate chrome help
-
Hi, I have this basic code snippet which loads google in my GUI and clicks the 'Im Feeling Lucky' Button. - This works fine by the way. _IENavigate($oIE, "https://www.google.co.uk") _IEAction($oIE, "stop") Local $oSubmit = _IEGetObjByName($oIE, "btnI") _IEAction($oSubmit, "click") _IELoadWait($oIE) Please could anyone tell me how I'd do the above but using chrome as the browser instead of IE? I know there is a Chrome UDF but I have no idea how to use it. Or is there another way to do this? Thanks am632
-
Read from text file and set variable
am632 replied to am632's topic in AutoIt General Help and Support
Hi Kaz, Thanks for the information am632 -
Read from text file and set variable
am632 replied to am632's topic in AutoIt General Help and Support
Hi Subz, Thanks for your help with this, I think example 1 should do the trick perfectly for my script. Just 1 quick question though, I see in your example you don't use FileOpen() - I thought this was required before you could use FileRead() but obviously I was wrong. What is the advantage of using $var = FileOpen() -> FileRead($var) over not using FileOpen() at all? or does the FileOpen Serve another purpose all together? Thanks am632 -
Read from text file and set variable
am632 replied to am632's topic in AutoIt General Help and Support
Hi, Thank you for your reply. You are correct in saying I want to find how many bottles of milk there are. To answer your questions the information is likely to always be on the same line but in less common cases it may not but the line is unique. I am ultimately planning on working with log files which are stored as .txt files. This is why I say there may be a possibility the line may change but the line will definite always be unique. By using the example I provided, I'll be able to adapt the solution to fit in with my script. Many thanks for your help am632 -
Hi, I have an example .txt file which contains the following string of characters "There are 5 bottles of milk" (without quotes) in my script dir so I have the following code to open/read the file #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> $File = FileOpen(@ScriptDir & "\testfile.txt") $FileRead = FileRead($File) $hFileRead = $FileRead I'd like to set the number 5 as a variable to be displayed in a MsgBox - My question is how would I do this, knowing that the number '5' in the .txt file could change outside of autoit? I was looking at the _FindInFile UDF found on this forum here autoitscript.com/forum/topic/132159-findinfile-search-for-a-string-within-files-located-in-a-specific-directory/ as I thought it may be a step in the right direction but I couldn't see how I'd do what I need to do. Please can anyone help? Thanks am632
-
Automate Webpage inside AutoIt GUI Advice
am632 replied to am632's topic in AutoIt General Help and Support
Hi, I just want to ask another question relating to this code. In the browser i'm making if I go to a website which has ads, it says 'please disable adblocker' - I only have an adblocker enabled in Chrome but it's actually disabled for the site I'm accessing anyway. Please can you suggest why this is happening and how do I stop it from asking to disable the adblocker? Are the IE form controls actually piggybacking of Chrome (or my default browser should I say)? Many Thanks am632 -
Automate Webpage inside AutoIt GUI Advice
am632 replied to am632's topic in AutoIt General Help and Support
That's great thanks -
Automate Webpage inside AutoIt GUI Advice
am632 replied to am632's topic in AutoIt General Help and Support
Hi, Thanks for your reply. I have looked at the IE example as you recommended & I managed to get a working example using google's 'I'm feeling lucky' button for clicks. The example I am working from is as follows #include <GUIConstantsEx.au3> #include <IE.au3> #include <WindowsConstants.au3> Local $oIE = _IECreateEmbedded() GUICreate("Google Search test", 1000,700,-1,-1) GUICtrlCreateObj($oIE, 0, 0, 1000, 700) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI _IENavigate($oIE, "http://www.google.com") _IEAction($oIE, "stop") Local $oSubmit = _IEGetObjByName($oIE, "btnI") _IEAction($oSubmit, "click") _IELoadWait($oIE) ; Waiting for user to close the window While 1 Local $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit I couldn't find an example of how to send text stored in a variable to the google search box though before clicking the search button. I'm sure there would be an example for this but as the help file is quite extensive maybe I'm just missing it - do you know how I would go about doing this please? Many Thanks -
Hi everyone, I'm hoping someone can offer any advice on the best way to automate webpage interaction from inside the AutoIt GUI instead of opening a web browser. My code is as follows #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $var = 0 HotKeySet("{ESC}", "Terminate") ;Create Main GUI $Main = GUICreate("Main",1024,768,-1,-1,-1,-1) GUISetState(@SW_SHOW, $Main) ;Create browser window inside GUI Local $oIE = ObjCreate("Shell.Explorer.2") GUICtrlCreateObj($oIE, 5, 5, 1014, 600) ; While 1 Sleep(300) If $var = 0 Then $var = 1 _GoTo_Google() EndIf WEnd ;Functions Func _GoTo_Google() $oIE.navigate("http://google.co.uk") EndFunc Func Terminate() Exit EndFunc So in my above program, google is loaded inside the AutoIt GUI - I'd like to learn how to automate text input and button clicks inside the gui without having to launch a separate browser. Please can anyone offer any suggestions or examples of the best way to do this please? I'd like to avoid simulating mouse movement and key presses. Thanks am632
-
Removing admin account from windows 10 login screen
am632 replied to JohnOne's topic in Windows Client
There is a command you can run in command prompt to turn off a user account without removing it, I dont know if it will be what you are looking for but you may want to check it out, just run the following. net user administrator /active:no you can replace 'administrator' with any user account name as well, and toggle no/yes