Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/17/2020 in all areas

  1. careca

    String Trigger

    Version 2.86

    897 downloads

    This is my take on string triggers, triggers on specific strings. Able to simple text pasting, opening links (as long as there's a www. http:\\ or https:\\ at the beggining) and is able to open applications, if there is a parameter in the parameter field, it uses it. Shows your lan, and gateway ip's, and opens them on a browser uppon click. Able to change system volume by a set percentage, reading from the inputbox the number the user sets, if 0 or empty uses system default. I made this because the existing string trigger applications didn't do it for me.
    1 point
  2. I love the help file and all the information it contains. Its fatal flaw is that it can't be added to. I create a lot of wrapper functions and install a lot of UDFs, so it gets tiring opening the include file each time I need to remember if it returns a 0 or 1 based array, what this particular error means, or what the argument should be. I've been fed up with this for too long, hence this script. Features Reads *.au3 files to parse UDF style headers to get function information (the UDF header style is defined here, thanks water!) Supports multiple search paths Integration with SciTe (more on this later) Stores function documentation so it doesn't need to re-read files each startup (Currently, in a config file) Only updates a file based on it's last modification date Will update another instance instead of launching a new one before exiting. Planned Updates Optionally (user's choice) use a SQLite Database to increase storage/read speeds Redirect unknown functions to AutoItHelper.exe to open the almighty Help File Remove functions from folders not in the search folders (would be a lot easier with SQLite) Fully support and parse UDF headers SciTE Integration This took me a while to figure out (I thought I needed to use lua), but it's totally worth it. By editing your "User Options File" aka SciTEUser.properties files, you can launch this file with a keyboard shortcut. I put this in mine: (After compiling) command.41.$(au3)="$(SciteDefaultHome)\..\FunctionDocs.exe" "$(CurrentWord)" command.name.41.$(au3)=Personal Function Docs command.shortcut.41.$(au3)=Shift+F1 command.subsystem.41.$(au3)=2 command.save.before.41.$(au3)=2 command.quiet.41.$(au3)=1 (Note that 41 is an unused command number. You may need to change this if you've added other tools) It says (respectively): * Launch FunctionDocs.exe from the directory above SciTE.exe with the currently selected word as a command line parameter * Make the MenuItem in SciTE named "Personal Function Docs" * Use Shift F1 as the shortcut to start the program * (I don't know) * Don't save the file before launching the program * (And my favorite) Don't clear SciTE's output panel
    1 point
  3. @Dhanaraju In that scenario, each session would need to run it's own copy of Chromedriver AFAIK. Otherwise, the Chrome instance will get created in the wrong session as you've discovered. I will try to play around with this when I get a chance.
    1 point
  4. @Danp2 So to speak the mistake sat in front of the pc. Putting it in the right format did all the magic and works fine now with this: $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-notifications"]}}}}' Thanks for your answers in the past!
    1 point
  5. @Langmeister Please put in some effort to identify the correct syntax. As mentioned earlier, you can find it with Google or searching in the forums.
    1 point
  6. Think you want this -- _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//img[@id='mdcaa79e9_tdrow_[C:0]_tgdet-ti[R:" & $ai & "]_img' and @title='Close Details']")
    1 point
  7. Here's complementary code to unescape JSON strings: ; unescape escape sequences in JSON strings Func _JsonTextToString($s) $s = StringTrimLeft(StringTrimRight($s, 1), 1) $s = StringReplace($s, '\"', '"') ; unescape " $s = StringReplace($s, '\b', Chr(0x08)) ; unescape backspace $s = StringReplace($s, '\f', Chr(0x0C)) ; unescape formfeed $s = StringReplace($s, '\t', @TAB) ; unescape @TAB $s = StringReplace($s, '\n', @LF) ; unescape @LF $s = StringReplace($s, '\r', @CR) ; unescape @CR $s = Execute("'" & StringRegExpReplace($s, "\\u([[:xdigit:]]{4})", "' & ChrW(0x$1) & '") & "'") ; unescape other chars in hex form \uXXXX $s = StringRegExpReplace($s, '\\([\\/])', '$1') ; unescape \ and / last Return $s EndFunc ;==>_JsonTextToString ; escape characters in strings w.r.t all relevant RFCs. Check https://jsonformatter.curiousconcept.com/ Func _StringToJsonText($s) $s = StringRegExpReplace($s, '([\\/])', '\\$1') ; escape \ and / first $s = StringReplace($s, '"', '\""') ; escape " $s = StringReplace($s, Chr(0x08), '\b') ; escape backspace $s = StringReplace($s, Chr(0x0C), '\f') ; escape formfeed $s = StringReplace($s, @TAB, '\t') ; escape @TAB $s = StringReplace($s, @LF, '\n') ; escape @LF $s = StringReplace($s, @CR, '\r') ; escape @CR $s = Execute('"' & StringRegExpReplace($s, '([\x00-\x1F\x7F-\x9F])', '" & "\\u" & Hex(AscW("$1"), 4) & "') & '"') ; escape other ctrl chars Return '"' & $s & '"' EndFunc ;==>_StringToJson ; unescape escape sequences in JSON strings Func _JsonTextToString($s) $s = StringTrimLeft(StringTrimRight($s, 1), 1) $s = StringReplace($s, '\"', '"') ; unescape " $s = StringReplace($s, '\b', Chr(0x08)) ; unescape backspace $s = StringReplace($s, '\f', Chr(0x0C)) ; unescape formfeed $s = StringReplace($s, '\t', @TAB) ; unescape @TAB $s = StringReplace($s, '\n', @LF) ; unescape @LF $s = StringReplace($s, '\r', @CR) ; unescape @CR $s = Execute("'" & StringRegExpReplace($s, "\\u([[:xdigit:]]{4})", "' & ChrW(0x$1) & '") & "'") ; unescape other chars in hex form \uXXXX $s = StringRegExpReplace($s, '\\([\\/])', '$1') ; unescape \ and / last Return $s EndFunc ;==>_JsonTextToString Escaping function named changed for symetry. Control chars appear in console if using a "good" font (e.g. DejaVu sans mono) in UTF8 mode. Please test and report. Might end up in less confidential thread.
    1 point
  8. Since using 3rd-party apps are not prohibited in your environment, have you looked at using CMail or SwithMail? I prefer cmail and have a UDF that wraps its functionality into a single function call. I have used CMail for several years without any issues and still use it in my scripts to this day. It can handle just about anything including STARTTLS/SMTPS, inline embedded attachments, priorities, delivery status notifications, and much more. Both are command line utility but can be easily run from scripts. Also, both are very reliable, highly functional, and easy to use. If your environment doesn't have an issue with 3rd party services, then you could look at using a service like SendGrid. If you don't foresee sending more than 100 emails a day, then it's free. It offers both a SMTP Relay and an API for sending email. I have used it in the past also. It is built for high-volume mass marketing campaigns but works just as well for the occasional email alert. It is a VERY feature-rich and reliable service and it has been around for a very long time. I'm not sure what kind of region setting is causing you so much grief but since SMTP is a standard that has been around for what seems like forever, I'm sure that whatever region issue you are encountering can be overcome. You should be able to find a single solution that meets your need or maybe have a single fail-over/backup solution. Having 4 or 5 solutions, that all do the same thing, seems a bit excessive -- but what do I know, right. Yes, you're right about time being a limiting factor. I forgot about that one. Being retired, time isn't usually something I think about much anymore. But time is a very important factor that can limit what's possible.
    1 point
  9. Hey everybody, this is my HotKeySet Code: HotKeySet("{NUMPAD0}", "_theFunctionToCall") And this is my function: Func _theFunctionToCall() While 1 $rd_time += 1 ConsoleWrite("testing code") If $rd_time > 200 Then ExitLoop EndIf WEnd EndFunc ;==>_theFunctionToCall Obviously my code is different. In my original code: in the while loop a label is changed in a gui (a kind of randomizer) .. The problem is that the script ends after about 200 milliseconds. if I call the function normal, everything is fine, but if I call the function via the hotkey, I can start it again if I just press the hotkey again. Is there any easy method to bypass this? So that you can't call the function again (via hotkey) while the function is already running? Maybe like a HotKeyReset?
    1 point
  10. Fixed it by myself. HotKeySet("{NUMPAD0}", "_theFunctionToCall") Func _theFunctionToCall() HotKeySet("{NUMPAD0}") ;reset hotkey While 1 $rd_time += 1 ConsoleWrite("testing code") If $rd_time > 200 Then HotKeySet("{NUMPAD0}", "_theFunctionToCall") ;set hotkey again before exit ExitLoop EndIf WEnd EndFunc ;==>_theFunctionToCall
    1 point
  11. spudw2k

    Always On Top Tool

    Had a customer who's Outlook somehow got Always on Top (AOT) enabled and we couldn't figure out how that happened or how to undo it. I put together a quick hack to turn it off, but then got inspired to make a (very simple) tool to allow toggling AOT on-demand via a hotkey. It runs in the notification area. Ctrl + Alt + T to toggle AOT for the active window. #NoTrayIcon #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <AutoItConstants.au3> #include <WinAPI.au3> Opt("TrayMenuMode", 3) Opt("TrayOnEventMode",1) HotKeySet("^!t","_ToggleActiveWindow") _UI() Func _UI() TrayCreateItem("&About") TrayItemSetOnEvent(-1, "__About") TrayCreateItem("") ; Create a separator line. TrayCreateItem("E&xit") TrayItemSetOnEvent(-1, "__Exit") TraySetState($TRAY_ICONSTATE_SHOW) TraySetToolTip("Always on Top Tool") While 1 sleep(10) WEnd EndFunc Func _ToggleActiveWindow() Local $hWnd = WinGetHandle("[ACTIVE]") Local $sTitle = WinGetTitle("[ACTIVE]") If $sTitle == "" Then Return -1 $iExStyle = __GetWindowState($hWnd, $GWL_EXSTYLE) If BitAND($iExStyle, $WS_EX_TOPMOST) Then $iExStyle = BitXOR($iExStyle,$WS_EX_TOPMOST) $hAfter = $HWND_NOTOPMOST $sMsg = "off" Else $iExStyle = BitOR($iExStyle,$WS_EX_TOPMOST) $hAfter = $HWND_TOPMOST $sMsg = "on" EndIf $aWinPos = WinGetPos($hWnd) _WinAPI_SetWindowLong($hWnd,$GWL_EXSTYLE,$iExStyle) _WinAPI_SetWindowPos($hWnd, $hAfter, $aWinPos[0], $aWinPos[1], $aWinPos[2], $aWinPos[3], $SWP_FRAMECHANGED) __ToolTip("AOT turned " & $sMsg, $aWinPos[0] + ($aWinPos[2]/2), $aWinPos[1] + ($aWinPos[3]/2), $sTitle, 0, $TIP_CENTER + $TIP_BALLOON) EndFunc Func __About() MsgBox($MB_SYSTEMMODAL, "", "Always on Top Tool" & @CRLF & @CRLF & "Press Ctrl + Alt + T to toggle" & @CRLF & "Always on Top for the active window.", 5) EndFunc Func __Exit() HotKeySet("^!t") Exit EndFunc Func __GetWindowState($hWnd, $iIndex) Return _WinAPI_GetWindowLong($hWnd, $iIndex) EndFunc Func __ToolTip($sMsg, $iX, $iY, $sTitle, $iICon, $iOptions) AdlibRegister("__ToolTipOff","1500") ToolTip($sMsg, $iX, $iY, $sTitle, $iICon, $iOptions) EndFunc Func __ToolTipOff() ToolTip("") AdlibUnRegister() EndFunc
    1 point
  12. _ClipPutFile("<your filename goes here>")
    1 point
×
×
  • Create New...