Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/04/2017 in all areas

  1. (This example uses a "flash" animation and therefore needs the "flash player" to work. Since "flash player" is discontinued and no longer present on many systems, this script may not work. I have therefore prepared a new script which does not use flash, but is based only on javascript. You can find it in this new post: www.autoitscript.com/forum/topic/206853-aquarium) If you set within a window, a given color as transparent, every area of that window painted with that color, act as an hole through wich you can see what's behind, and click on what's behind as well. What's funny is that if you embed a browser control within that window, the "transparent" color works even within the browser! This allow some interesting effects by simply opening any of the many javascript animations, or css effects or whatever within a browser control embedded into a GUI: Here, for example, is a simple effect of fishes swimming around on the screen. For lazyness I have embedded an ready made swf flash by a link to the web, but is of course possible embed any web page with javascripts css or whatever..... Have fun #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Misc.au3> ; for _IsPressed (23 END key) Local $hDLL = DllOpen("user32.dll"), $oIE = ObjCreate("Shell.Explorer.2") Local $hBackground = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUPWINDOW, $WS_EX_LAYERED + $WS_EX_TOPMOST) Local $AlphaKey = 0xF0F7FF ; everything with color $AlphaKey within this window will be transparent ; even if within an embedded browser control!..... _WinAPI_SetLayeredWindowAttributes($hBackground, $AlphaKey, 0, $LWA_COLORKEY) GUISetState(@SW_SHOW, $hBackground) $hIE = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth, @DesktopHeight) ; <- embedd $oIE in the AutoIt GUI GUISetBkColor($AlphaKey, $hBackground) ; $AlphaKey $hBackground transparent $oIE.navigate('http://cdn.abowman.com/widgets/fish/fish.swf') ; $oIE.navigate('http://cdn.abowman.com/widgets/spider/spider.swf') ; a spider goes around on the screen .... ; !! to use the spider.swf, you need to set $AlphaKey = 0xffffff on line 7 "! While True If _IsPressed("23", $hDLL) Then ExitLoop ; END key was pressed Sleep(250) WEnd $oIE = "" $hDLL = "" GUIDelete($hBackground)
    1 point
  2. For testing I have created the exact same folder structure and added the script and ini files as you specified above. In my script I used the following: Local $utenteFAKEorNOT = 'mascetti_luigi' ConsoleWrite('$utenteFAKEorNOT = ' & $utenteFAKEorNOT & @CRLF) Local $pLFakePath = @ScriptDir & "\WEB-SITE\eBay\utenti\" & $utenteFAKEorNOT & "\utente_ebay.ini" ConsoleWrite('$pLFakePath = ' & $pLFakePath & @CRLF) ConsoleWrite('FileExists = ' & FileExists($pLFakePath) & @CRLF) Which the console returned $utenteFAKEorNOT = mascetti_luigi $pLFakePath = C:\_GESTIONALE_NEW\WEB-SITE\eBay\utenti\mascetti_luigi\utente_ebay.ini FileExists = 1 Can you create a new script in _GESTIONALE_NEW with the code above and let me know the results?
    1 point
  3. I DL's your AutoSizer program and took a look at the code. I was surprised/impressed that the code was not overly complex. nice job! Right now I have a few other AutoIt projects in the works, but at a future date I'd like to check out your program and perhaps make some mods. Have you considered memorizing the desktop Icons & positions?
    1 point
  4. Nice ! here it is #Include <Array.au3> $aNames = StringRegExp(FileRead("Test Input.txt"), '(?m)^SI\w+', 3) ; _ArrayDisplay($aNames) $sNames = _ArrayToString($aNames, ", ") ; MsgBox(0, "$sNames", $sNames) FileWrite(@scriptdir & "\Output.txt", $sNames)
    1 point
  5. You might post the txt file, It would be much easier to make tests However assuming that the names begin with SI and end with BLU you could try this - obviously untested, lazily I didn't copy the content of your image to a txt file #Include <Array.au3> $txt = FileRead("test.txt") $aNames = StringRegExp($txt, '(?m)^SI\d+BLU', 3) _ArrayDisplay($aNames) $sNames = _ArrayToString($aNames, ", ") MsgBox(0, "$sNames", $sNames)
    1 point
  6. Bert

    Automation best practices

    This is my list of do's and don't when automating an application using AutoIt. 1. You should always write out a pseudo script defining what you want to do BEFORE you write any code. The best way to define what you are doing is document your steps you do manually. Keep it simple. 2. Hooking into controls for non- web based applications: In many cases the basic AutoIt commands will work fine. If not then this will work: https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ 3. If you are working with a web based application you can use IE.au3 or take a look at this: https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/ 4. Pixel searching: It should NEVER be used unless there is no other option (and all other methods have been tried first to hook into the control in question). The reasons being are many: If the pixel gets moved for some reason - your script breaks. window resized - script breaks pixel color is changed due to the app being updated in some manner - script breaks it is slow for for some cases you may have to search a large area. 5. Command line switches - if you are dealing with a package you wish to install and you wish to automate it - look to see if the package supports command line switches. This can make a multi-line script a simple one line script and make your installs much more stable. 6. Script stability: What this basically means is you account for possible failures that may occur when your script runs. For example if your script is waiting for a window to gain focus, you may want to put in a time out or an alert if the window fails to appear. There are many options that one can do for this sort of thing. If you are not sure on what to do, ask in the forum and another member can make a few suggestions for you. 7. The AutoIt help file is your friend. For just about every command there is an example and you have a search function in the help file. USE IT! If you can't find what you need there then look in the forum and use the forum's search function FIRST before posting a question. 8. When you run into trouble with your script: Post it in the Help and support section of the AutoIt forum so we can help you.
    1 point
  7. That's true, No I used AutoSizer as a visual template of what I wanted it to look like. His program is nice but will only move and size when a hot key is pressed. I wanted one that would move in real time as soon as the window appears. @PeteF It wouldn't be hard to incorporate a hotkey function that would just add the active windows size and location to the monitored list. That way it was hands off so to speak. Might also be a good idea for pasky windows that hide when focus is stolen from them.
    1 point
  8. The onclick code is associated with an image, so I would suggest trying _IEImgClick, ie: _IEImgClick($oIE, "Zobrazit údaje docházky", "alt") _IEImgClick($oIE, "Zobrazit údaje docházky", "alt", 1)
    1 point
  9. @dextry - Recommend you look at http://saplsmw.com/Log_on _to_SAP_automatically_without_being_prompted_for_credentials I've used this method in the past for creating a special SAP Shortcut for Auto Logon which when you right click and edit the password without it being in clear text in a file.
    1 point
  10. Yeah, it work perfectly thank a lot for the support:D
    1 point
  11. Look at your hands and the screen, if your finger clicks on the icon and selects compile from the context menu, it's unlikely being compiled with scite.
    1 point
  12. @weirddave - Can you check the value of RegRead('HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command', '') Just wondering if its missing parameters on the command line e.g. "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %*
    1 point
  13. Thank you guys for the support in looking to this post. I figured it out and error was already fixed. What I did is I only removed the below code and declared IsObj() in the script. Also, I've gave them the access right of the server but limited to folder specification. And all runs perfectly.      FileWriteLine($sDataFilePath, GUICtrlRead($Input1)) Thanks, everyone for the good ideas.
    1 point
  14. aa2zz6, Write noting to the edit control like this... #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <date.au3> #AutoIt3Wrapper_Add_Constants=n Local $gui010 = GUICreate('Edit Example') $log = GUICtrlCreateEdit("", 20, 40, 360, 300) Local $btn010 = GUICtrlCreateButton('Clear', 20, 360, 360, 20) GUISetState() AdlibRegister('Write_Log', 100) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btn010 GUICtrlSetData($log, '') ; <----- clear the log EndSwitch WEnd ; fill the log up to show scrolling Func Write_Log() GUICtrlSetData($log, _NowCalc() & @CRLF, 1) EndFunc ;==>Write_Log Most of the styles you specify are already defaults... kylomas
    1 point
  15. @LinkOut Welcome to the forum. Thanks for sharing. Please make saparate Thread and upload your UDF here: https://www.autoitscript.com/forum/files/category/19-social-media-and-other-website-api/ After that I will add your UDF to this list: https://www.autoitscript.com/wiki/User_Defined_Functions#Databases_and_web_connections
    1 point
  16. careca

    First Script Woes...

    What you're asking is to change the other process window state if i got it right. I don't know about changing trayitemtext, didn't look at it even, but here's what i got that i think may suit what you're looking for: #Region ;Wrapper #pragma compile(UPX, false) #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Res_SaveSource=y ;#AutoIt3Wrapper_Icon= ;#AutoIt3Wrapper_Res_Icon_Add= ;#AutoIt3Wrapper_Outfile= ;#AutoIt3Wrapper_Res_Comment= ;#AutoIt3Wrapper_Res_Description= #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #EndRegion ;Wrapper ;============================================================================= #Region ;FileInstall ;FileInstall("file", @ScriptDir & "\file") #EndRegion ;FileInstall ;============================================================================= #Region #include <GUIConstants.au3> #include <TrayConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> #include <WinAPI.au3> #EndRegion ;============================================================================= #Region OnAutoItExitRegister("Quit") Opt("TrayMenuMode", 1) Opt("TrayIconHide", 0) Opt("GUICoordMode", 1) Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 0) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) Opt("WinDetectHiddenText", 1) #EndRegion ;============================================================================= #Region Global $GUI, $totray, $restore, $exititem, $WinState, $hTray_Show_Item Local $Exists = 0 Local $aProcessList = ProcessList("single.exe") ;maybe singleton is better, but here's my idea, list processes with said name For $i = 1 To $aProcessList[0][0] ;loop through all If $Exists = 0 Then ;finds first one $Exists = 1 ;sets var to 1 Else MsgBox(64, $i, 'Second Instance') ;at the next instance, var is already 1 so it jumps here _WinAPI_ShowWindow(WinGetHandle("Test Window"), @SW_SHOW) ;show window with that title/handle. Exit ;out because this was the second instance EndIf Next $GUI = GUICreate("Test Window", 180, 75, 500, 200) GUISetState() TraySetState(1) TraySetClick(16) $WinState = 1 TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "Window") GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") $totray = TrayCreateItem("Tray") TrayItemSetOnEvent(-1, "ToTray") $restore = TrayCreateItem("Restore") TrayItemSetOnEvent(-1, "RestoreT") $exititem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") #EndRegion ;============================================================================= Func Window() If $WinState = 0 Then GUISetState(@SW_SHOW, $GUI) $WinState = 1 Else GUISetState(@SW_HIDE, $GUI) $WinState = 0 EndIf EndFunc ;==>Window ;============================================================================= Func ToTray() TrayItemSetState($totray, $TRAY_UNCHECKED) GUISetState(@SW_HIDE) $WinState = 0 EndFunc ;==>ToTray ;============================================================================= Func RestoreT() TrayItemSetState($restore, $TRAY_UNCHECKED) GUISetState(@SW_SHOW) $WinState = 1 EndFunc ;==>RestoreT ;============================================================================= Func Minimize() WinSetState($GUI, '', @SW_MINIMIZE) EndFunc ;==>Minimize ;============================================================================= Func Restore() WinSetState($GUI, '', @SW_RESTORE) EndFunc ;==>Restore ;============================================================================= Func Quit() Exit EndFunc ;==>Quit ;============================================================================= Do Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE hope it makes sense, to test this, compile it, and run, hide it. run it again, the second one will close and bring the first one up. As i said, maybe singleton is better, but i don't understand it very well. PS: There's also this: Local $aProcessList = ProcessList("SomeApp.exe") If $aProcessList[0][0] >= 2 Then Exit
    1 point
  17. Almost sure that will corrupt your excel file, but I may be wrong. Anyways, try this (untested): Func SaveClick() Local $oExcel, $oWorkbook, $bFileExist, $iLastRow Local $bVisible = False ; set to True to show Excel window $oExcel = _Excel_Open($bVisible, False, False, False) If @error Then ConsoleWrite("! Err: " & @error & " - Failed to Create Excel Object" & @CRLF) Return SetError(1, 0, False) EndIf $bFileExist = FileExists($sDataFilePath) If $bFileExist Then $oWorkbook = _Excel_BookOpen($oExcel, $sDataFilePath, False, True) Else $oWorkbook = _Excel_BookNew($oExcel) EndIf If @error Then ConsoleWrite("! Err: " & @error & " - Failed to " & ($bFileExist ? "Open" : "Create new") & " Excel file" & @CRLF) Return SetError(2, 0, False) EndIf $iLastRow = $oExcel.Application.Selection.SpecialCells($xlCellTypeLastCell).Row Local $oRange = _Excel_RangeWrite($oWorkbook, Default, GUICtrlRead($Input1), "A" & $iLastRow + 1) ; insert error check here _Excel_BookSaveAs($oExcel, $sDataFilePath, $xlExcel8, True) ; $xlExcel8 = .xls format ; insert error check here Return 1 EndFunc ;==>SaveClick
    1 point
  18. wakillon

    SDL2 Firework

    A little try with SDL 2 Library, SDL 2 GFX and Sid music. As usual, no externals files needed. Press "Esc" for quit. SDL2_Fireworks.au3 Happy New Year 2017
    1 point
  19. careca

    First Script Woes...

    I have a template that does what you want.. if i got it right, maybe you can take what you need, ideas. #Region ;Wrapper #pragma compile(UPX, false) #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Res_SaveSource=y ;#AutoIt3Wrapper_Icon= ;#AutoIt3Wrapper_Res_Icon_Add= ;#AutoIt3Wrapper_Outfile= ;#AutoIt3Wrapper_Res_Comment= ;#AutoIt3Wrapper_Res_Description= #AutoIt3Wrapper_Res_Fileversion=1.0 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #EndRegion ;Wrapper ;============================================================================= #Region ;FileInstall ;FileInstall("file", @ScriptDir & "\file") #EndRegion ;FileInstall ;============================================================================= #Region #include <GUIConstants.au3> #include <TrayConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #EndRegion ;============================================================================= #Region OnAutoItExitRegister("Quit") Opt("TrayMenuMode", 1) Opt("TrayIconHide", 0) Opt("GUICoordMode", 1) Opt("GUIResizeMode", 1) Opt("TrayIconDebug", 1) Opt("TrayAutoPause", 0) Opt("MouseCoordMode", 2) Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 0) Opt("GUIEventOptions", 1) Opt("TrayOnEventMode", 1) Opt("ExpandEnvStrings", 1) Opt("WinDetectHiddenText", 1) #EndRegion ;============================================================================= #Region Global $GUI, $totray, $restore, $exititem, $WinState $GUI = GUICreate("Test Window", 180, 75, 0, 0) GUISetState() TraySetState(1) TraySetClick(16) $WinState = 1 TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "Window") GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") $totray = TrayCreateItem("Tray") TrayItemSetOnEvent(-1, "ToTray") $restore = TrayCreateItem("Restore") TrayItemSetOnEvent(-1, "RestoreT") $exititem = TrayCreateItem("Close") TrayItemSetOnEvent(-1, "Quit") #EndRegion ;============================================================================= Func Window() If $WinState = 0 Then GUISetState(@SW_SHOW, $GUI) $WinState = 1 Else GUISetState(@SW_HIDE, $GUI) $WinState = 0 EndIf EndFunc ;==>Window ;============================================================================= Func ToTray() TrayItemSetState($totray, $TRAY_UNCHECKED) GUISetState(@SW_HIDE) $WinState = 0 EndFunc ;==>ToTray ;============================================================================= Func RestoreT() TrayItemSetState($restore, $TRAY_UNCHECKED) GUISetState(@SW_SHOW) $WinState = 1 EndFunc ;==>RestoreT ;============================================================================= Func Minimize() WinSetState($GUI, '', @SW_MINIMIZE) EndFunc ;==>Minimize ;============================================================================= Func Restore() WinSetState($GUI, '', @SW_RESTORE) EndFunc ;==>Restore ;============================================================================= Func Quit() Exit EndFunc ;==>Quit ;============================================================================= Do Sleep(100) Until GUIGetMsg() = $GUI_EVENT_CLOSE
    1 point
  20. No problem, was it what you were looking for?
    1 point
  21. There is, but there is also the possiblity that someone can get the password. #include <GUIConstantsEx.au3> $Ini = @ScriptDir& '\Text.ini' If FileExists($Ini) Then Local $TextIniRead1 = IniRead($Ini, "Paste", "1", "Not found") Else IniWrite($Ini, "Paste", "1", '') EndIf HotKeySet('{+}', 'Text') Func Text() ConsoleWrite($TextIniRead1 & @CRLF) Send($TextIniRead1) Send("{TAB}") EndFunc ;==>Mail1 Do Sleep(100) Until $GUI_EVENT_CLOSE=1 Very simple, just to showcase.
    1 point
  22. FYI , just found out how to do it , in case anyone else runs into this Use the below from a run dialog and it works for office 2016 "C:\Program Files\Microsoft Office\root\Client\AppVLP.exe" rundll32.exe shell32.dll,Control_RunDLL "C:\Program Files\Microsoft Office\root\Office16\MLCFG32.CPL"
    1 point
×
×
  • Create New...