Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. @mikell, Thanks and that would be a great idea and it's fine, but how can I add these words back in the XML tags at the same place where they were replaced/removed from the string and they don't need to be in the element same as below.πŸ˜… The words "and", "In:" and "Eds." should be putted back to where they should be and no need to be tagged in element.
  3. Hello Everyone! Would request your help on how to saveas a file in its previous location. Lets say file 1 path : C:\Windows\User1\file1.txt file 2 path : C:\Users\User2\file2.txt I have written a script that will saveas both file and save in the same location (lets say desktop). How can i modify the script so that the files will be saved as file 1 : C:\Windows\User1\file1_copy.txt file 2 : C:\Users\User2\file2_copy.txt. Thanks in advance
  4. Could you try running it with the latest production version of SciTE4AutoIt3 (v19.102.1901.0) so we can check whether the command is reshelled ( like happens with UAC). The latest version will still show the console messages of the new PID? Jos
  5. Today
  6. You could try this visual tool to get "selectors" of DOM objects: https://www.autoitscript.com/forum/topic/195777-ie-dom-elements-visual-selector-tool/ The selectors obtained by this tool can be used in this WebDriver UDF. Example: suppose you store in the variable $sMyCssSelector the string of the CSS selector retrieved with the above visual tool, you can then use that variable in the _WD_FindElement function() in this way: $RefElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, $sMyCssSelector)
  7. As I see the things becoming gradually more and more complicated with extra words emerging, The best way I can think of is to first carefully remove all these useless extra words from the initial string, so the code will not be overcomplicated and the reliability will be greatly improved ; delete "and" in names, (Eds.), In: ... to be probably continued $str = StringRegExpReplace($str, '((?<=,\h)and(?=\h[A-Z])|\(Eds.\)|(?<=\.\h)In:)\h?', "")
  8. What do you get when you run this script? #AutoIt3Wrapper_UseX64=n #include <OutlookEx.au3> _OL_ErrorNotify(2) Global $oOL = _OL_Open() Global $oNamespace = $oOL.GetNamespace("MAPI") Global $sCurrentUser = $oNameSpace.CurrentUser.Name MsgBox(0, "Result", $sCurrentUser)
  9. Yes that is correct. The issue seems to be only limited to the part where AutoIt actually performs the execution of the script... πŸ˜•
  10. My Outlook is 32bits and my Windows is 64bits. I also tried : $sCurrentUser = $oNameSpace.CurrentUser.Name I am not able to get the script working.
  11. @FrancescoDiMuro, yes, I tried that doing "(\(Eds\.)\)" to match the expression but this word should not be tag in XML, it's the same with "et al.,".πŸ˜… same as below.
  12. Sorry, just to clarify, running the AutoIt exe does show the file select window, but no script execution is observed? Or do you not get the file select window either?
  13. @spudw2k I have tried this as well, the same result happens as if I provide the script path as a parameter.
  14. Hmmm, what a mystery. If you just run AutoIt.exe from a command line without the script path as a parameter, does it open the file select window to choose the script file...and subsequently selecting it, does the script execute?
  15. @argumentum Nothing out of the ordinary in the file's permissions or attributes πŸ˜• @FrancescoDiMuro They point to a directory on the host computer, VirtualBox provides a GUI to create shared folders: https://www.virtualbox.org/manual/UserManual.html#sharedfolders @spudw2k Yes to both questions, everything works fine (including running EXEs from the shared drives) except AutoIt not being able to execute scripts within them
  16. @KickStarter15 Both round parentheses and the dot are metacharacters, so, to let them be threated literally by the RegEx engine, you need to escape each of them with a backslash
  17. My question had nothing to do with keylogging in the least, but trying to figure out how to have single response to a menu. (See attached images for screenshot of the script in use, the bumpbar keypad which is a limited keyboard input device being used, and the final application installed and running) for a restaurant kitchen video controller installer I am trying to construct. I am just trying to make sure I am approaching this correctly and to figure out why sometimes my inputs are not being read even though the keypad beeps when pressed.
  18. Thank you so much @mikell it's much better now. however, I have two more questions so far,πŸ˜…... First: what if the person name contains the word "and" before the last person mentioned. Like the below: Local $astr[2] = ["Wagner, W., Raudsepp, M., Holtz, P., Sen, R., (2017) Essence politics Identity work and stereotyping in inter-group relations. Haward C., Matt C., The social psychology of everyday politics. London. Routledge. 121-150." , _ "Wagner, W., Raudsepp, M., Holtz, P., and Sen, R., (2017) Essence politics Identity work and stereotyping in inter-group relations. Haward, C., and Matt, C., The social psychology of everyday politics. London. Routledge."] ; with word "and" before the last person... Second: There are extra words within the other person name which is the (Eds.) abbreviation for "Editors". Local $astr[2] = ["Wagner, W., Raudsepp, M., Holtz, P., Sen, R., (2017) Essence politics Identity work and stereotyping in inter-group relations. Haward C., Matt C., (Eds.), The social psychology of everyday politics. London. Routledge. 121-150." , _ ; this contains word "(Eds.)" "Wagner, W., Raudsepp, M., Holtz, P., and Sen, R., (2017) Essence politics Identity work and stereotyping in inter-group relations. In: Haward, C., and Matt, C., (Eds.), The social psychology of everyday politics. London. Routledge."] ; this is containing both words "In:" and "(Eds.)" And I made the expression to read the word Eds. to be excluded but it will produced incorrect capturing. Is this correctπŸ˜₯.. If StringRegExp($res[$i], '((Eds.))') Then $s &= $res[$i] & @crlf $i += 1 EndIf
  19. Are you able to see the contents of W: or UNC path? / Does the shared drive seem to be working properly otherwise?
  20. such kind of images (strips) can also be handled by the _GUIImageList* functions. Have a look to this link for an example of use https://www.autoitscript.com/forum/topic/165083-question-on-_guiimagelist-usage/. In your case posted here, since you want to use it with the TraySetIcon() function, and since that function accepts a filename as parameter, you should convert the frames of the strip at least in single icons, and save them to disk, or, by the workaround from this post (https://www.autoitscript.com/forum/topic/97902-trayseticon-with-handle/) you can manage it by the image handle. here a quick and dirty example: #include <GuiImageList.au3> #include <WinAPI.au3> #include <GDIPlus.au3> ; ---------------------- ; https://www.autoitscript.com/forum/topic/97902-trayseticon-with-handle/ Global Const $tagNOTIFYICONDATAW = _ 'dword cbSize;' & _ 'hwnd hWnd;' & _ 'uint uID;' & _ 'uint uFlags;' & _ 'uint uCallbackMessage;' & _ 'hwnd hIcon;' & _ 'wchar szTip[128];' & _ 'dword dwState;' & _ 'dword dwStateMask;' & _ 'wchar szInfo[256];' & _ 'uint uVersion;' & _ 'wchar szInfoTitle[64];' & _ 'dword dwInfoFlags;' ; & $tagGUID Global $tNID = DllStructCreate($tagNOTIFYICONDATAW), $pNID = DllStructGetPtr($tNID) Global $hWnd = WinGetHandle(AutoItWinGetTitle()), $hIcon ; ---------------------- Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "Quit") Example() Func Example() _GDIPlus_Startup() ; Load Image Local $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & ".\Bitmap351.bmp") Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) ; convert GDIPlus bitmap to GDI format which is usable for _GUIImageList* functions ; there are 31 images (frames) in strip Local $iFramesInStrip = 31 Local $iFrameWidth = _GDIPlus_ImageGetWidth($hBitmap) / $iFramesInStrip Local $iFrameHeight = _GDIPlus_ImageGetHeight($hBitmap) _GDIPlus_BitmapDispose($hBitmap) ; release GDIPlus bitmap because not needed anymore $hImages = _GUIImageList_Create($iFrameWidth, $iFrameHeight, 5) ; create image list in 32-bit which supports transparency _GUIImageList_Add($hImages, $hGDIBitmap) ; add the whole strip to the ImageList ; Create a little GUI $hGUI = GUICreate("Demo", 150, 80) GUICtrlCreateLabel("see the tray icon...", 10, 10, 140) GUICtrlSetFont(-1, 12) GUICtrlCreateButton("Quit", 40, 40, 80) GUICtrlSetOnEvent(-1, "Quit") GUISetState(@SW_SHOW) Do For $i = 0 To $iFramesInStrip - 1 ; loop all frames $hIcon = _GUIImageList_GetIcon($hImages, $i) DllStructSetData($tNID, 'cbSize', DllStructGetSize($tNID)) DllStructSetData($tNID, 'hWnd', $hWnd) ;HWnd($hGUI)) ; DllStructSetData($tNID, 'uID', 1) DllStructSetData($tNID, 'uFlags', 2) DllStructSetData($tNID, 'hIcon', $hIcon) _Shell_NotifyIcon(1, $pNID) ; TraySetIcon() Sleep(250) Next Until False EndFunc ;==>Example Func Quit() ; free memory _GDIPlus_Shutdown() _WinAPI_DestroyIcon($hIcon) GUIDelete() Exit EndFunc ;==>Quit Func _Shell_NotifyIcon($iMessage, $pdata) Local $aRet $aRet = DllCall('shell32.dll', 'int', 'Shell_NotifyIconW', 'dword', $iMessage, 'ptr', $pdata) If @error Then Return SetError(1, 0, 0) Return $aRet[0] EndFunc ;==>_Shell_NotifyIcon
  21. Yesterday
  22. Use an icon tool (I use IcoFx 1.6 this version is free) and create multiple .ico files, then follow the link below which shows you how to add the icons to your compiled exe and then display them in the system tray: https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/adding-extra-icons-to-the-program-resources.html
  23. When I run my program below for some reason when the ClickDepartmentButton is called, it causes COM errors and the program to freeze and basically fails... But when I run the ClickDepartmentButton function by itself without running the rest of the code, it works perfectly everytime. Is there something I am doing wrong? Or do I need to perhaps 'reset' the UIA engine or something? I have no clue why it doesn't work when I run it as part of the whole program, but on it's own, it works fine. I even tried to insert a 10second pause to make sure the program was REALLY fully loaded, and it still failed. Local $omega1 = _UIA_getFirstObjectOfElement($UIA_oDesktop, $program, $treescope_children) Local $SDLI = _UIA_getFirstObjectOfElement($omega1, "Analytical", $treescope_subtree) _UIA_action($SDLI, "click") Local $omega2 = _UIA_getFirstObjectOfElement($UIA_oDesktop, $program, $treescope_children) Local $SDLI = _UIA_getFirstObjectOfElement($omega2, "Sample Due", $treescope_subtree) Dim $t $t = StringSplit(_UIA_getPropertyValue($SDLI, $UIA_BoundingRectanglePropertyId), ";") MouseMove($t[1] + ($t[3] / 20), $t[2] + $t[4] / 2) $hTimerDebug = TimerInit() ; Begin the timer and store the handle in a variable. MouseClick("left") AutoItSetOption("MouseCoordMode", 0) WinWait(" - [frmMC_SampleDue]") ClickRefreshButton() ;Click the refresh button - This will cause the program (msaccess) to poll server for data - the program will freeze, this is normal behavior for that software so WaitForHungAndUnhung WinWaitForProgramToStartResondingAgain() WinActivate(" - [frmMC_SampleDue]") ; No effect - Click Department Button still causes freezing/COM errors. ClickDepartmentButton() Func ClickRefreshButton() _UIA_setVar("oP1", "Title:= - [frmMC_SampleDue];controltype:=UIA_WindowControlTypeId;class:=OMain") ;McCampbell Omega_Me - [frmMC_SampleDue] _UIA_setVar("oP2", "Title:=Workspace;controltype:=UIA_PaneControlTypeId;class:=MDIClient") ;Workspace _UIA_setVar("oP3", "Title:=frmMC_SampleDue;controltype:=UIA_WindowControlTypeId;class:=OForm") ;frmMC_SampleDue _UIA_setVar("oUIElement", "Title:=Get Data;controltype:=UIA_ButtonControlTypeId;class:=") ;ControlType:=UIA_ButtonControlTypeId;classname:=") _UIA_Action("oP1", "setfocus") _UIA_Action("oP2", "setfocus") _UIA_Action("oP3", "setfocus") _UIA_action("oUIElement", "click") EndFunc ;==>ClickRefreshButton Func WinWaitForProgramToStartResondingAgain() ;Move a window around, and track how long it takes for it to actually move. $c = 0 Do $hTimerDebug = TimerInit() Local $aPos = WinGetPos(" - [frmMC_SampleDue]") WinMove(" - [frmMC_SampleDue]", "", $aPos[0] + 10, $aPos[1] + 10, $aPos[2] - 20, $aPos[3] - 20) WinMove(" - [frmMC_SampleDue]", "", $aPos[0], $aPos[1], $aPos[2], $aPos[3]) Local $r = WinGetState(" - [frmMC_SampleDue]") Local $fDiff = TimerDiff($hTimerDebug) If $fDiff < 1000 Then $c = 1 ConsoleWrite("Time it took for winmove was: " & $fDiff & @CRLF) Until $c = 1 EndFunc ;==>WinWaitForHungAndUnhung Func ClickDepartmentButton() _UIA_setVar("oP1", "Title:= - [frmMC_SampleDue];controltype:=UIA_WindowControlTypeId;class:=OMain") ; - [frmMC_SampleDue] _UIA_setVar("oP2", "Title:=Workspace;controltype:=UIA_PaneControlTypeId;class:=MDIClient") ;Workspace _UIA_setVar("oP3", "Title:=frmMC_SampleDue;controltype:=UIA_WindowControlTypeId;class:=OForm") ;frmMC_SampleDue _UIA_setVar("oUIElement", "Title:=Dept:;controltype:=UIA_TextControlTypeId;class:=") ;ControlType:=UIA_TextControlTypeId;classname:=") _UIA_Action("oP1", "setfocus") _UIA_Action("oP2", "setfocus") _UIA_Action("oP3", "setfocus") _UIA_action("oUIElement", "click") EndFunc ;==>ClickDepartmentButton ERROR from my ComErrorHandler: SampleDueLoaderv2.1.au3 (1128) : ==> Global COM error handler - COM Error intercepted ! err.number is: 0x00000003 err.windescription: NULL Pointer assignment err.description is: err.source is: err.helpfile is: err.helpcontext is: err.lastdllerror is: 0 err.scriptline is: 1128 err.retcode is: 0x00000000
  24. So, why do you think it will work then as it is simply one single image? YOu obviously need to have a properly formatted file for this to work as there is no miracle parameter available. Jos
  25. bunch of icons combined into 1 image, extracted from batmeter.dll
  26. Is this an proper ICO file or just a bunch of icons combined into one image? Jos
  27. Tried to ask for help here . Since obviously this dont work and i dont know what else to try i dont see what were other options: TraySetState($TRAY_ICONSTATE_SHOW) For $i = 1 to 100 Sleep(500) TraySetIcon(@ScriptDir & "\Bitmap351.bmp", $i) Next
  1. Load more activity
×
×
  • Create New...