Leaderboard
Popular Content
Showing content with the highest reputation on 06/14/2023 in all areas
-
Can I work without activating program?
SkysLastChance and one other reacted to ioa747 for a topic
check it Example() Func Example() ; Run Notepad Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Set the state of the Notepad window to minimize WinSetState($hWnd, "", @SW_MINIMIZE) ; Send a string of text to the edit control of Notepad. For $x = 1 to 50 ControlSend($hWnd, "", "Edit1", "This is some text in line:" & $x & @LF) Next ; Set the state of the Notepad window to restore WinSetState($hWnd, "", @SW_RESTORE) EndFunc ;==>Example So generally don't use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc. Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc. Doing so allows you to interact with an application regardless of whether it is active or not. take a look at https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F2 points -
I have just noticed the OP wanted details for a .docx file. I've not tried one, only an ODF file as a test. All works as it should. I have adapted my code with the details recently posted by @Heiko #include <MsgBoxConstants.au3> $fname = "full/file path/and filename/with.extension" $cURL = Convert2URL($fname) $oServiceManager = ObjCreate("com.sun.star.ServiceManager") ;< create the service manager $oDesktop = $oServiceManager.createInstance("com.sun.star.frame.Desktop") ;< create the desktop object Global $args[3] ;< set the array of properties $args[0] = MakePropertyValue("ReadOnly", False) $args[1] = MakePropertyValue("Password", "") $args[2] = MakePropertyValue("Hidden", False) $oDoc = $oDesktop.loadComponentFromURL($cURL, "_blank", 0, $args) ;< open an existing document #cs WARNING: Selecting the ViewCursor from PageStyles, the cursor must be on the page you want details returned. A single page document will always show the default settings. A document can have many pages formatted as portrait or landscape or a mixture of both. #ce $ViewCursor = $oDoc.CurrentController.getViewCursor() $PageStyle = $ViewCursor.PageStyleName $Style = $oDoc.StyleFamilies.getByName("PageStyles").getByName($PageStyle) $PageHeight = $Style.height $PageWidth = $Style.width $PageOrientation = $Style.isLandscape ConsoleWrite($PageHeight & " x " & $PageWidth &@LF) ConsoleWrite("Page is landscape: " & $PageOrientation &@LF) MsgBox($MB_SYSTEMMODAL, "RESULTS", "Is Landscape: " & $PageOrientation & @CRLF & _ "Page Width: " & $PageWidth & @CRLF & _ "Page Height: " & $PageHeight & @CRLF & _ "Page/Paper Size: " & $PageHeight/100 & "x " & $PageWidth/100) if @error or Not IsObj($oDoc) then SetError(1, 0, 0) EndIf Func MakePropertyValue($cName, $uValue) Local $Pstruc $Pstruc = $oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue") $Pstruc.Name = $cName $Pstruc.Value = $uValue Return $Pstruc EndFunc Func Convert2URL($fname) $fname = StringReplace($fname, ":", "|") $fname = StringReplace($fname, " ", "%20") $fname = "file:///" & StringReplace($fname, "\", "/") Return $fname EndFunc code Mehomic1 point
-
@NassauSky A few things I can see -- You should check for an empty result from _WD_GetElementFromPoint. You need to adjust for window position or change setting of MouseCoordMode. You will likely get better results using _WD_GetMouseElement.1 point
-
I found a VBA code and could change it, so it works now $ViewCursor = $doc1.CurrentController.getViewCursor() $PageStyle = $ViewCursor.PageStyleName $Style = $doc1.StyleFamilies.getByName("PageStyles").getByName($PageStyle) $PageHeight = $Style.height/100 $PageWidth = $Style.width/100 $PageOrientation = $Style.isLandscape ConsoleWrite($PageHeight & " x " & $PageWidth &@LF) ConsoleWrite("Page is landscape: " & $PageOrientation &@LF) The result is e.g.: 210.01 x 297 Page is landscape: True1 point
-
Moved to the appropriate forum. Moderation Team1 point
-
https://allaboutcookies.org/how-to-turn-off-google-password-manager https://stackoverflow.com/a/46602329/5314940 https://sqa.stackexchange.com/a/26515/14581 _WD_CapabilitiesAdd('prefs', 'credentials_enable_service', False) ; https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-12272021/?do=findComment&comment=1464829 _WD_CapabilitiesAdd('prefs', 'profile.password_manager_enabled', False) ; https://sqa.stackexchange.com/a/26515/145811 point
-
set User Account Picture
t0nZ reacted to JLogan3o13 for a topic
Well if they are non-domain, are the computers company-owned or BYOD? If company-owned, you're going to be limited to PSExec running as SYSTEM, and are going to run into issues connecting to them over the open internet. If BYOD, you're out of luck as you don't have permission to do anything on those devices.1 point -
That's the GuiGetMsg, a bigger block in the FileRead helps for getting better performance, using: $dTempData = FileRead($hFile, Ceiling($iFileSizeForProgress / 100)) will effect better performance for files gt 51200 kb, but smaller files will be slower than actual.1 point
-
Why not using ward's Machine Code Algorithms that will run each of these hash functions in few milliseconds at worst, so nothing will have to freeze.1 point
-
Inserting a block like this in the 2. Do .. Until (func _Crypt_HashFile2) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ;ESC => break hashing $vReturn = -1 ExitLoop 2 Case Else ;hash the data EndSwitch is a possible solution wich breaks if user use the X-Button or press ESCape.1 point
-
WebDriver UDF - Help & Support
GreeNerO reacted to loulou2522 for a topic
For easy comprehension I don't use : $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": { "acceptInsecureCerts":true, "unhandledPromptBehavior": "ignore","goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false,"prefs": {"credentials_enable_service": false}, "args":["start-minimized","--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Patrickun", "disable-infobars"]}}}}' But if you use another profile like me 'partrickun' the problem is the same you can test it Maybe i make something tha't is wrong ?1 point -
WebDriver UDF - Help & Support
GreeNerO reacted to ngocthang26 for a topic
Hi Danp 2, thanks you reply1 point -
I would suggest to use "goog:chromeOptions" instead of "chromeOptions" and add "excludeSwitches": ["enable-automation"] in the options. Since I don't have a crx flle, I tested loading extension folder and it worked OK, even though a balloon popped up warning not to use an extension when Chrome is in developer mode. My test capabilities are as below: $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, ' & _ '"args": ["start-maximized", "load-extension=C:\\users\\cycho\\appdata\\local\\google\\chrome\\user data\\default\\extensions\\pkedcjkdefgpdelpbcmbmeomcjbeemfm\\7819.902.0.1_0"] }}}}' The extension folder is the folder where manifest.json file for the extension is located.1 point