seangriffin

Chrome UDF

100 posts in this topic

#21 ·  Posted (edited)

Something is not right here.
Since I re-installed, device manager network tab says I'm uploading at my full capacity.
I don't know what I'm uploading or what is uploading it, I have nothing running which should do that.

EDIT:

For the record.

This issue was with my AV not recognizing new files and uploading them for inspection.

Nothing to do with this UDF or its components.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites



Hi Folks, 

I have kind of an issue here:

I've strictly followed the instruction for the installation. But I face kind of a weird situation when I run the script #1.

OS: W7 64-bit.

AutoIt: V3.3.8.1

When I launch the script ( chrome_example.au3 ) ==> Nothing happens or appears...

But When I use the AutoIt debugger tool, it works like a charm. 

Any thought would tremendously appreciated. 

Cheer

L

Share this post


Link to post
Share on other sites

#23 ·  Posted (edited)

Something is not right here.

Since I re-installed, device manager network tab says I'm uploading at my full capacity.

I don't know what I'm uploading or what is uploading it, I have nothing running which should do that.

 

Hmmm, odd that something is uploading.  There certainly isn't anything in this solution that uploads or downloads.

Here's a description of exactly what the 3 components to the UDF do (in case anyone was wondering):

  1. The Chrome UDF - is an AutoIT UDF that sends requests to the Native Messaging Host (below), via a text file, and waits for a response from the Native Messaging Host (below), via a text file.
  2. The Native Messaging Host - is a Python application that listens for requests from the AutoIT UDF (above), via a text file, and forwards those requests onto the Chrome Extension (below).  It also listens for output from the Chrome Extension (below) and forwards that back to the AutoIT UDF (above), via a text file.
  3. The Chrome Extension - is a collection of Javascript files that wait for a request from the Native Message Host (above), and then injects that request (Javascript) into the page within Chrome to interact with the elements in that page.  The response from this request is then sent back to the Native Message Host (above).

All these components communicate to each other through a combination of text files and stdio.  There are no HTTP requests involved, and as such I wouldn't expect any uploads or downloads to occur through the UDF.

Try Example #2 because it works "offline".  It should work without an internet connection, and that will eliminate any uploading or downloading going on.

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia

Share this post


Link to post
Share on other sites

#24 ·  Posted (edited)

I noticed now that native messaging host is no longer starting with chrome when the example is started.

I've tried a number of things, with chrome already running and without.

If I manually start messaging host, it ends when example is ran.

Is the value in registry supposed to be an escaped path...

"C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostmanifest.json"?

I don't see any other paths in registry where the backslashes are escaped.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I noticed now that native messaging host is no longer starting with chrome when the example is started.

I've tried a number of things, with chrome already running and without.

If I manually start messaging host, it ends when example is ran.

Is the value in registry supposed to be an escaped path...

"C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostmanifest.json"?

I don't see any other paths in registry where the backslashes are escaped.

 

Yes, it might seem odd that the registry value is escaped, though it must be this way or the native messaging host won't start.  That's my experience.

Here's more information to help in troubleshooting.  Thanks for spending the time on this.  Might help others too.

To confirm the native messaging host is starting with Chrome as expected, I would first try starting Chrome on it's own, without loading any pages or using the UDF.  Then go to Windows Task Manager and you should see the a process named autoit-chrome-native-messaging-host.exe.   This will confirm that the registry value above is set correctly, as this points Chrome to the location of the Native Messaging Host such that it can start it when Chrome starts..  

If autoit-chrome-native-messaging-host.exe isn't running when you start Chrome then get the value of the registry key above, and in Windows Explorer go to this location (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Host).  Check the file  autoit-chrome-native-messaging-host.exe and manifest.json exist.  Open manifest.json in Notepad.  Make sure "path" is set to the full path of autoit-chrome-native-messaging-host.exe, and the path includes double-backslashes.  Also make sure the value for "allowed_origins"opmlbgppkkdeleedejakphgmgiigjjga/) matches the value in the ID field of the Chrome Extension.  Check this by opening Chrome and go to the Tools -> Extensions menu item.  In the Extensions page make sure Developer mode is ticked, and then locate the ID field for the AutoIT for Chrome extension.  This value should match the value for "allowed_origins" in the manifest.json file.

If the settings above are correct, then every time you start Chrome, irrespective of whether you are using AutoIT or not, you should also have the autoit-chrome-native-messaging-host.exe process running.

The next step is to confirm if the AutoIT UDF is talking properly to the Native Messaging Host (autoit-chrome-native-messaging-host.exe).  Run an AutoIT script that uses the UDF (Chrome.au3), like one of the Examples from the top post.  When a function in the UDF is called, it should create a file named input.txt in the same location as autoit-chrome-native-messaging-host.exe (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostinput.txt).  This file should contain some Javascript relating to the UDF function called (i.e. document.getElementsByName('ExampleForm')[0].method;).  If Chrome and the Native Messaging Host (autoit-chrome-native-messaging-host.exe) are running, then the Native Messaging Host should immediately detect this file (i.e. C:UsersJOHNAppDataRoamingAutoIt3Chrome Native Messaging Hostinput.txt) whenever it's created, read it's contents and remove the file.  The Native Messaging Host is so fast at doing this that you may not even see the existence of input.txt.  Try running a UDF function without Chrome running and make sure input.txt is created. 

If input.txt is successfully created, then autoit-chrome-native-messaging-host.exe should automatically consume it (as described above), pass the Javascript onto the Chrome Extension, which uses it in Chrome and sends a response back to autoit-chrome-native-messaging-host.exe which should in turn create an output.txt file in the same location as input.txt.  The Chrome UDF then detects this file, reads in the response, and the UDF function completes.


Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia

Share this post


Link to post
Share on other sites

Hi Folks, 

I have kind of an issue here:

I've strictly followed the instruction for the installation. But I face kind of a weird situation when I run the script #1.

OS: W7 64-bit.

AutoIt: V3.3.8.1

When I launch the script ( chrome_example.au3 ) ==> Nothing happens or appears...

But When I use the AutoIt debugger tool, it works like a charm. 

Any thought would tremendously appreciated. 

Cheer

L

 

Mhmhmmh here is the deal:

The library use "@ProgramFilesDir" which return the directory for 64 bits. But Chrome is still 32 bits. 

So I used this code:

$ProgramFilesDir = EnvGet('ProgramFiles(x86)') ; for 64bit Win it will return a valid path.
if not $ProgramFilesDir then $ProgramFilesDir = @ProgramFilesDir ; for 32bit Win this will "repair" the broken return from above.
 
or
 
Func _ProgramFilesDir()
    Local $ProgramFileDir
    Switch @OSArch
        Case "X32"
            $ProgramFileDir = "Program Files"
        Case "X64"
            $ProgramFileDir = "Program Files (x86)"
    EndSwitch
    Return @HomeDrive & "" & $ProgramFileDir
EndFunc   ;==>_ProgramFilesDirh

 

Cheers

L

Share this post


Link to post
Share on other sites

When i look at the documentation inside the UDF the timeout periods state that the timeouts are for 'X' number of minutes, when you look at the code as well as the console output, the timeout is in 'seconds'

No big deal, just noticed it was documented wrong.

Share this post


Link to post
Share on other sites

V0.5 of the UDF is now released.

Python has now been replaced with AutoIT as the Native Messaging Host.  This brings significant performance improvements over the previous Python solution, and also allows easier maintenance in the future with a complete AutoIT solution.

If you already have a previous version of the UDF installated, then you must repeat Steps 1, 2 and 3 from the INSTALLATION section of the top post.

1 person likes this

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia

Share this post


Link to post
Share on other sites

#30 ·  Posted (edited)

Hi, everybody! 

Great topic, but I didn't find a function that allows me to click on a button with necessary text on it. 

Could you help me with this problem?

Edited by levshkatov

Share this post


Link to post
Share on other sites

Is there a way to find a surtend Word and then execute a command? that would be great :)

Share this post


Link to post
Share on other sites

#32 ·  Posted (edited)

I don't suppose there would be a way to use objects, since this is all read in from a text file...such as, having multiple windows/documents open, and differentiating between them.  Or looking for an element under an object?

Small fix, the _ChromeDocWaitForExistenceByTitle is not properly comparing the return string, so it always timesout.

Expected return string is like:

{"text":"HTML Form Example"}

if StringCompare($title_from_chrome, '{"text":"' & $title & '"}') = 0 Then

this fixes it ( inside _ChromeDocWaitForExistenceByTitle)

Func _ChromeDocWaitForExistenceByTitle($title, $timeout = 5)

    dim $error = 2, $response = "", $begin, $title_from_chrome

    $begin = TimerInit()

    While TimerDiff($begin) < ($timeout * 1000)

        $title_from_chrome = _ChromeDocGetTitle()
        if StringCompare($title_from_chrome, '{"text":"' & $title & '"}') = 0 Then
            $error = 0
            ExitLoop
        EndIf

        sleep(100)
    WEnd

    SetError($error)

    Return $response
EndFunc
Edited by jdelaney
1 person likes this

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Would this work on a locked Windows like the ControlSend ControlClick commands?

Share this post


Link to post
Share on other sites

Wow compliments! thank you for the work you are sharing with us!

I'm working on the function _IELinkClickByText 
someone has already done? I'm having trouble!

Share this post


Link to post
Share on other sites

Seems really nice, though I would recommend not using file to communicate between scripts, this would speed up the process considerably, as it takes much longer to read/write data to the hard disk than it does to transfer it in RAM. 

Share this post


Link to post
Share on other sites

_IELinkClickByText chrome alternative ?

Share this post


Link to post
Share on other sites

#37 ·  Posted (edited)

_IELinkClickByText chrome alternative ?

Too long for a response to this question. Interested in a simple click on the link in chrome. Who knows the answer?

Edited by Jordanoise

Share this post


Link to post
Share on other sites

I think I may have stumbled on the cause of the problem that some people are coming across where this UDF does not appear to work.

I too had issues with Chrome opening fine, shutting down fine, but no communication could be made with the messaging host.  Everything always timed out.

My software info:

Win 7 x64

Chome 33

AutoIt 3.3.6

Firstly I discovered that no registry entry had been made for me during installation. I did have a SoftwareGoogleChrome entry under HKEY_CURRENT_USER but no NativeMessagingHosts key.

As per a previous post, I decided to put the keys where specified so had to create a SoftwareGoogleChromeNativeMessagingHosts key tree under HKEY_LOCAL_MACHINE. Still having problems I put the same registry entries under HKEY_CURRENT_USER but still no go (after discovering the actual problem later I think either location should be fine)

After finding the great post detailing a full breakdown of the UDF and how it all works, I went though step by step and discovered that the first time Chrome is run, the autoit-chrome-native-messaging-host process was running.

Now, here comes the root problem (I think). If you run the command _ChromeShutdown() from AutoIt at the beginning of your script (which closes Chrome windows and kills the autoit-chrome-native-messaging-host process), then your next _ChromeStartup command will NOT re-open the messaging process. I think it's down to having multiple chrome processes still running (non-windowed like other plugins) so Chrome doesn't do a fresh startup and doesn't restart it's messaging hosts.

So, short answer just now is to close your chrome windows (and chrome processes) manually and only use _ChromeShutdown() at END of script.

Now the UDF works fine. Although you've still got to end all chrome processes manually before you run your script again.

Over to the developer. Not sure it's the best way, but you could end all chrome.exe processes in the _Shutdown function rather than closing any open Chrome windows. I'm sure you'll find a better way.

Hope this helps some of you.

1 person likes this

Share this post


Link to post
Share on other sites

Hello, first of all thankyou!!

I have try to use this on local files, but even in your second example is not working for me, online or works fine, but on local doesn´t change any value (inputs (textfield/checkboxes/radio...))

Any idea?

Regards.

Share this post


Link to post
Share on other sites

I'm not directly using the chrome UDF but i took a lot of tricks from it that don't work anymore!

For example the basic "[REGEXPTITLE:.*- Google Chrome]" was glorious to get a quick window handle.

But for some reason there is no "- Google Chrome" at the end of tabs anymore (or only rarely instead of on everything)

Do you know how to reenable it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • fenhanxue
      By fenhanxue
      Q 1:
      How to judge whether the Chrome has been installed. How to get the complete route of chrome if it is installed?

      Q 2:
      How to judge whether the Adobe Flash Player has been installed.
    • FMS
      By FMS
      Hello,
      I'm trying to wright a automated process to show some URL's in chrome browsers on multiple screens.
      I've 4 screens and want to show on each screen another instance of chrome whit its own URL.
      In mine search on the site i din't find any topic for this specific problem.
      The way I was trying is something like :
      ShellExecute("chrome.exe", "http://URL1 --start-maximized") so I'll not see the addressbar but it was not opend full screen .
      I've some questions about this way:
      -Is there a way to maximize it on a dedicated screen ?
      (like URL1 on screen 1 , URL2 on screen 2 etc...)
      -Shellexecute will add a tab on a existing browser and will not open another instance, is there a way to work around this?
      Is there somebody who had the same problem whit chrome?
      thanks in advanced.
      edit: I've checked the chrome UDF but it din't same to get the job done....
    • imitto
      By imitto
      Hello all!
      I use Autoit for a while, already made some automation for a TV station's master control room with it. I made a UDF to easily work with PAL timecode and time with milliseconds, convert, add or subtract them. Feel free to use it if you want something like this
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=PAL Timecode Calculator UDF #AutoIt3Wrapper_Res_LegalCopyright=horvath.imre@gmail.com #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; ; #FUNCTION# ; Name...........: _tcAdd ; Description....: Returns addition of two timecodes ; Syntax.........: _tcAdd($fTc1, fTc2 [, $fFormat = "P"]) ; ; Parameters.....: $fTc1 - First timecode in hh:mm:ss.ff format ; $fTc2 - Second timecode in hh:mm:ss.ff format ; $fFormat - Time base - "P" (default): PAL (25 fps) ; "M" : millisecond ; ; Return value...: Sum of the two timecode in the selected format Func _tcAdd($fTc1, $fTc2, $fFormat = "P", $fHourFormat = 1) Local $fMs1 = _tcToMs($fTc1) Local $fMs2 = _tcToMs($fTc2) Local $fSumMs = $fMs1 + $fMs2 Return _msToTc($fSumMs, $fFormat, $fHourFormat) EndFunc ; #FUNCTION# ; Name...........: _tcsSub ; Description....: Returns addition of two timecodes ; Syntax.........: _tcSub($fTc1, fTc2 [, $fFormat = "P"]) ; ; Parameters.....: $fTc1 - First timecode in hh:mm:ss.ff format ; $fTc2 - Second timecode in hh:mm:ss.ff format ; $fFormat - Time base - "P" (default): PAL (25 fps) ; "M" : millisecond ; ; Return value...: Subtract $fTc2 from $fTc1 in the source format Func _tcSub($fTc1, $fTc2, $fFormat = "P") Local $fMs1 = _tcToMs($fTc1) Local $fMs2 = _tcToMs($fTc2) Local $fSumMs = $fMs1 - $fMs2 If $fSumMs < 0 Then $fSumMs = _tcToMs("24:00:00.00") - ($fSumMs * -1) EndIf Return _msToTc($fSumMs, $fFormat) EndFunc ; #FUNCTION# ; Name...........: _tcToMs ; Description....: Returns timecode converted to total milliseconds ; Syntax.........: _tcToMs($fTc) ; ; Parameters.....: $fTc - Timecode in hh:mm:ss.ff or hh:mm:ss:xxx format, where xxx are milliseconds ; ; Return value...: Milliseconds as an integer value Func _tcToMs($fTc) Local $fTemp = StringSplit($fTc, ":.") Local $fChr = StringLen($fTemp[4]) Switch $fChr Case 2 Return ($fTemp[4] * 40) + ($fTemp[3] * 1000) + ($fTemp[2] * 60000) + ($fTemp[1] * 3600000) Case 3 Return ($fTemp[4]) + ($fTemp[3] * 1000) + ($fTemp[2] * 60000) + ($fTemp[1] * 3600000) EndSwitch EndFunc ; #FUNCTION# ; Name...........: _msToTc ; Description....: Converts total milliseconds to timecode ; Syntax.........: _msToTc($fIn, $fFormat = "P", $fHourFormat = 1) ; ; Parameters.....: $fIn - Time in milliseconds ; $fFormat - Output format "P": PAL TC (default) ; "M": hh:mm:ss.xxx where xxx are milliseconds ; $fHourFormat - Hour format "1": max. value is 23, then starts from 0 (default) ; "0": hours can be more then 23 ; ; Return value...: Timecode as string in the selected format Func _msToTc($fIn, $fFormat = "P", $fHourFormat = 1) Switch $fFormat Case "P" Local $fFr = StringFormat("%02i", (StringRight($fIn, 3) - Mod(StringRight($fIn, 3), 40)) / 40) Case "M" Local $fFr = StringFormat("%03i", StringRight($fIn, 3)) EndSwitch $fIn = StringTrimRight($fIn, 3) Local $fSec = StringFormat("%02i", Mod($fIn, 60)) $fIn -= $fSec Local $fMinTot = $fIn / 60 Local $fMin = StringFormat("%02i", Mod($fMinTot, 60)) $fIn -= $fMin*60 Local $fHourTot = $fIn / 60 / 60 Switch $fHourFormat Case 1 $fHour = StringFormat("%02i", Mod($fHourTot, 24)) Case 0 $fHour = StringFormat("%02i", $fHourTot) EndSwitch Return($fHour & ":" & $fMin & ":" & $fSec & "." & $fFr) EndFunc ; #FUNCTION# ; Name...........: _tcFormatChange ; Description....: Toggle TC format ; Syntax.........: _tcFormatChange($fTc) ; ; Parameters.....: $fTc - Timecode in hh:mm:ss.ff or hh:mm:ss:xxx format, where xxx are milliseconds ; ; Return value...: PAL timecode or time with milliseconds as string, depends on input Func _tcFormatChange($fTc) Local $fTemp = StringSplit($fTc, ":.") Local $fChr = StringLen($fTemp[4]) Switch $fChr Case 2 Return $fTemp[1]&":"&$fTemp[2]&":"&$fTemp[3]&"."&StringFormat("%03i", $fTemp[4]*40) Case 3 Return $fTemp[1]&":"&$fTemp[2]&":"&$fTemp[3]&"."&StringFormat("%02i", ($fTemp[4]-Mod($fTemp[4], 40))/40) EndSwitch EndFunc And the example script:
      #include<_PAL_TC_Calc.au3> $palTC1 = "00:01:12.20" $palTC2 = "23:59:50.02" $msTC1 = "00:01:12.800" $msTC2 = "23:59:50.120" MsgBox(0, "1", _tcAdd($palTC1, $palTC2)); Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns PAL TC format MsgBox(0, "2", _tcAdd($palTC1, $palTC2, "M")); Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns time with milliseconds format MsgBox(0, "3", _tcAdd($palTC1, $palTC2, "M", 0)); Adds $palTC1 to $palTC2, hours can be infinite, returns time with milliseconds format MsgBox(0, "4", _tcAdd($msTC1, $msTC2)); Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns PAL TC format MsgBox(0, "5", _tcAdd($msTC1, $msTC2, "M")); Adds $palTC1 to $palTC2, turns hour back to 0 after 23, returns time with milliseconds format MsgBox(0, "6", _tcAdd($msTC1, $msTC2, "M", 0)); Adds $palTC1 to $palTC2, hours can be infinite, returns time with milliseconds format MsgBox(0, "7", _tcSub($palTC2, $palTC1)); Subtract $palTC1 from $palTC2, returns PAL TC format MsgBox(0, "8", _tcSub($palTC2, $palTC1, "M")); Subtract $palTC1 from $palTC2, time with milliseconds format MsgBox(0, "9", _tcSub($msTC1, $msTC2)); Subtract $palTC1 from $palTC2, returns PAL TC format - when hits zero, counts back from 24:00:00.00 MsgBox(0, "10", _tcSub($msTC1, $msTC2, "M")); Subtract $palTC1 from $palTC2, time with milliseconds format - when hits zero, counts back from 24:00:00.000 MsgBox(0, "11", _tcFormatChange($palTC2)); Convert PAL TC to time with milliseconds and back MsgBox(0, "12", _tcFormatChange($msTC2)); Convert PAL TC to time with milliseconds and back  
      TC_CALC_example.au3
      _PAL_TC_Calc.au3
    • TRAGENALPHA
      By TRAGENALPHA
      A small UDF to Modify the Console Interface.
      #include-once ;#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ; =============================================================================================================================== ; Name...........: Console Modify ; Description ...: A small UDF to manipulate the Console Interface for scripts that are compiled as a console application. ; Syntax.........: _ConsoleClear() -- Clears the Console ; _ConsoleTitle("VALUE") - Sets the console title. ; _ConsoleWindow([WIDTH BUFFER SIZE], [HEIGHT BUFFER SIZE]) - Sets the Width and Height Buffer size of the console. ; Parameters ....: $bh6e5v_ctval = Title of the Console Window. ; $bh6e5v_cwwidth = Window width buffer size. ; $bh6e5v_cwheight = Window height buffer size. ; Return values .: True = Console window buffer size has been changed ; False = Failed to change console window buffer size. ; Author ........: TRAGENALPHA <3 ; Example .......: _ConsoleTitle("This is the new title") // _ConsoleWindow(200, 60) ; =============================================================================================================================== ; -- This is here because writing RunDos and including a whole UDF is too much. But this is basically just _RunDos() ;Func cmd($bh6e5v_ldvar) ; RunWait(@ComSpec & " /c " & $bh6e5v_ldval) ;EndFunc Func _ConsoleClear() RunWait(@ComSpec & " /c cls") EndFunc Func _ConsoleTitle($bh6e5v_ctval) RunWait(@ComSpec & " /c title " & $bh6e5v_ctval) EndFunc Func _ConsoleWindow($bh6e5v_cwwidth, $bh6e5v_cwheight) If IsNumber($bh6e5v_cwwidth) And IsNumber($bh6e5v_cwheight) And ($bh6e5v_cwwidth > 0) And ($bh6e5v_cwheight > 0) Then RunWait(@ComSpec & " /c mode con: cols=" & $bh6e5v_cwwidth & " lines=" & $bh6e5v_cwheight) Return True Else Return False EndIf EndFunc  
      ConsoleModify.au3
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian