Jump to content
seangriffin

Chrome UDF

Recommended Posts

wowxxoo

Recently Google has  disabled all extensions not from the google extension store. That's why this UDF stopped work, cause autoit extension was disabled by chrome. There are several ways to hack this but the most appropriate for my goals was to downgrade chrome.

This politics was annonced by Google in the January 2014 so all versions of Chrome after January automatically disables non store extensions. I chose the latest stable version of Chrome before 2014, it is 31.0.1650.63. Then I modified my host file (C:WINDOWSsystem32driversetchosts) with usual Windows notepad and added this strings:

this strings prevent Chrome from upgrading.

Pros

I have working version of Chrome where I can install any extension I want and this extansions are enabled each time I start up Chrome.

Cons

I have not the latest version of Chrome with possible drawbacks, but I have this version installed on my virtual machine so for me it's not a minus at all.

P.S. One can have up-to-date Chrome and working extension, but each time you start up Chrome you will see annoying message about non store extension with suggestion to disable it.

 

And i have a easy  way to slove this problem:

1, open the chrome extension;

2, open development model;

3, drag  the plugin  into the extended chrome!

Ok! Fixed! Enjoy

For any version of chrome.

Share this post


Link to post
Share on other sites
JohnWIlling

Are you still supporting this.  This has been very useful but we ran into some conditions when using various constructions kits like JFace, JQuery, etc..  The html elements do not have "name" attributes but do have generated "id" attributes.  I added some additional routines to support this:

; #FUNCTION# ;===============================================================================
;
; Name...........: _ChromeLoadURL()
; Description ...: Load a URL web page based.
; Syntax.........: _ChromeLoadURL($url, $timeout = 5)
; Parameters ....: $url         - the URL to load
;     $timeout     - Optional: a number of minutes before exiting the function.
; Return values .:  On Success     - Returns "".
;                  On Failure     - Returns "", and sets @ERROR = 2.
; Author ........: seangriffin
; Modified.......:
; Remarks .......: A prerequisite is that the Chrome browser is open
;     (Window title = "[REGEXPTITLE:.*- Google Chrome]").
;
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _ChromeLoadURL($url, $timeout = 30)

 Dim $response = ""

 $response = Chrome_Eval("Chrome_LoadURL=" & $url, $timeout)

 SetError(@error)

 Return $response
EndFunc


; #FUNCTION# ;===============================================================================
;
; Name...........: _ChromeInputClickByID()
; Description ...: Clicks an <input> element based on it's "ID" attribute.
; Syntax.........: _ChromeInputClickByID($objid, $timeout = 5)
; Parameters ....: $objid       - the value of the "name" attribute
;     $timeout     - Optional: a number of minutes before exiting the function.
; Return values .:  On Success     - Returns "".
;                  On Failure     - Returns "", and sets @ERROR = 2.
; Author ........: seangriffin
; Modified.......:
; Remarks .......: A prerequisite is that the Chrome browser is open
;     (Window title = "[REGEXPTITLE:.*- Google Chrome]").
;
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _ChromeInputClickByID($objid, $timeout = 5)

 dim $response = ""

 $response = _ChromeEval("document.getElementByID('" & $objid & "').click();", $timeout)

 SetError(@error)

 return $response
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........: _ChromeObjGetValueByID()
; Description ...: Gets the value of an element based on it's "id" attribute.
; Syntax.........: _ChromeObjGetValueByID($objid, $index = 0, $timeout = 5)
; Parameters ....: $objid       - the value of the "id" attribute
;     $timeout     - Optional: a number of minutes before exiting the function.
; Return values .:  On Success     - Returns $value.
;                  On Failure     - Returns "", and sets @ERROR = 2.
; Author ........: seangriffin
; Modified.......:
; Remarks .......: A prerequisite is that the Chrome browser is open
;     (Window title = "[REGEXPTITLE:.*- Google Chrome]").
;
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _ChromeObjGetValueByID($objID, $timeout = 5)

 dim $response = ""

 $response = _ChromeEval("document.getElementByID('" & $objid & "').value;", $timeout)

 SetError(@error)

 return $response
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........: _ChromeObjSetValueByID()
; Description ...: Sets the "value" attribute of a element based on it's "id" attribute.
; Syntax.........: _ChromeObjSetValueByID($objid, $value, $timeout = 5)
; Parameters ....: $objid       - the value of the "id" attribute
;     $value      - The text to set the "value" attribute to
;     $timeout     - Optional: a number of minutes before exiting the function.
; Return values .:  On Success     - Returns $value.
;                  On Failure     - Returns "", and sets @ERROR = 2.
; Author ........: seangriffin
; Modified.......:
; Remarks .......: A prerequisite is that the Chrome browser is open
;     (Window title = "[REGEXPTITLE:.*- Google Chrome]").
;
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _ChromeObjSetValueByID($objid, $value, $timeout = 5)

 dim $response = ""

 $response = _ChromeEval("document.getElementByID('" & $objid & "').value = '" & $value & "';", $timeout)

 SetError(@error)

 return $response
EndFunc

 

Would you be able to add these to your base?  We also added _ChromeLoadURL to change the current URL  I added the following to contentscript.js:

 if (request.greeting.indexOf("Chrome_LoadURL=") == 0)
 {
  var arg = request.greeting.substr("Chrome_LoadURL=".length);

  window.location.assign(arg);
 }

chrome_additional.au3

contentscript.js

Share this post


Link to post
Share on other sites
conmed

 

And i have a easy  way to slove this problem:

1, open the chrome extension;

2, open development model;

3, drag  the plugin  into the extended chrome!

Ok! Fixed! Enjoy

For any version of chrome.

I can not activate the extension , I can not follow the steps you indicate . How I can do step 2 ??

Share this post


Link to post
Share on other sites
Scripty123

Wow,

This is exactly what I'm looking for, but like "conmed", I cannot get the extension enabled using the workaround. 

Can you elaborate wowxoxo? or maybe this no longer works in the latest versions of Chrome.

I don't suppose it's feasible to actually get the extension published on the Chrome Web Store? I guess Google might not allow it anyway since the tool could be used maliciously.  

Share this post


Link to post
Share on other sites
wliebkem

I am also stuck and unable to use the extension at all.

I followed install instructions including using admin install for autoit_chrome_native_messaging_host_install.exe

I checked "Developer Mode" in Chrome when installing AutoIT for Google Chrome.crx (actually I installed it in both developer and non-developer).

I am not observing that the correct registry entries have been made during the install process.  Should I manually create these keys?  The first example script will load the form but not fill it out, and eventually times out.

Every time I check the Chrome Extensions, the "Enable" box for AutoIT for Google Chrome has been unchecked, even in developer mode, and "Not from Chrome web store" sites underneath the unchecked box.

Downgrading chrome is not an option for me as my autoit application serves an environment in which other software requires specific modern versions of Chrome.

Any hope or is Chrome automation dying off from Autoit?  Would obviously be very supportive of attempts to get the tool added to the Chrome store if that is the obstacle.

Cheers

 

Autoit v3.3.12.0

Win 7 64 bit

Chrome 44.0.2403.89 m

Edited by wliebkem

Share this post


Link to post
Share on other sites
pd

Chrome support for AutoIT is here!  :D

This UDF includes a Chrome Extension (http://developer.chrome.com/extensions/getstarted.html) and Native Messaging Host (http://developer.chrome.com/extensions/messaging.html#native-messaging-host) that integrate with a new Chrome UDF (Chrome.au3) to provide automation support for the Chrome browser.

Several steps are required to install the Chrome Extension and Native Messaging Host prior to using the UDF.  Please read the INSTALLATION section below.

REQUIREMENTS:

  • Windows XP 32-bit, Windows 7 32-bit or Windows 7 64-bit
  • AutoIt3 3.2 or higher
  • Chrome v29 or later (earlier versions are untested)
  • AutoIT for Google Chrome (Chrome extension - see below)
  • AutoIT Chrome Native Messaging Host (see below)

INSTALLATION:

STEP 1: Install the AutoIT extension into Chrome.

Open the following link and download the file named AutoIT for Google Chrome.crx:

https://docs.google.com/file/d/0B_6JmwNIIZ06enotRTVFNVdKOXM/edit?usp=sharing

Note - you may be prompted to login with a Google account as this file is hosted on Google Drive.

In your Chrome browser click on the Chrome menu, then select Tools -> Extensions.  Drag the AutoIT for Google Chrome.crx file that you downloaded above, from Windows Explorer, into this page in Chrome.  You should now see AutoIT for Google Chrome listed in the Extensions page in Chrome.  Ensure that the Enabled checkbox next to AutoIT for Google Chrome is checkedAlso make sure the Allow access to file URLs box is checked (very important to make EXAMPLE 2 work below)!!

STEP 2: Install the AutoIT Chrome Native Messaging Host.

Open the following link and download the file named autoit_chrome_native_messaging_host_install.exe:

https://docs.google.com/file/d/0B_6JmwNIIZ06eDgxaVJPNUNxa28/edit?usp=sharing

Note - you may be prompted to login with a Google account as this file is hosted on Google Drive.

Run this file (autoit_chrome_native_messaging_host_install.exe).  An installation window will display.  Click the Install button.  The window will display "Completed" and you can click the Close button.

STEP 3: Install the Chrome UDF into AutoIT.

Scroll to the DOWNLOAD section below, and save the Chrome.au3 file into your AutoIT Include folder (C:Program FilesAutoIt3Include).

Please close your Chrome browser once you've completed these steps.

LIST OF FUNCTIONS:

 

EXAMPLE #1:

This following example starts up Chrome and navigates to the URL http://www.december.com/html/demo/form.html.  It then automatically completes the HTML form in this page (a series of text, radio, and checkbox input elements and select elements) and clicks the Send this survey button.  The script waits for the next page to load, and retrieves the various elements from the page to the AutoIT console.

chrome_example.au3

EXAMPLE #2:

The following is an example of the automation of an offline HTML page (file URL).  First, download the file named chrome_udf_example_2.html to your C: folder:

https://docs.google.com/file/d/0B_6JmwNIIZ06SWduMjZGTVViNlU/edit?usp=sharing

Then run the following AutoIT script:

chrome_example_2.au3

Note that you must have checked the Allow access to file URLs box in the Chrome extension to make this work!

DOWNLOAD:

Latest Version - v0.5 (29/09/13)

Chrome.au3

Hi Seangriffin,

I have done all these steps but when I test my script, chrome disables the Extension for AutoIt because it is not from Chrome web store. If says that uploading extension to chrome web store will resolve the issue.

Is there any other solution to it?

Thanks,

PD

Share this post


Link to post
Share on other sites
pd

This is also not working. I have same code in UDF. but when I run chrome, it opens up the page but in editor gives below error.

C:\Program Files (x86)\AutoIt3\Include\Chrome.au3 (829) : ==> Variable used without being declared.:
$response = _ChromeEval("document.getElementByID('" & $objname & "').value = '" & $value & "';", $timeout)
$response = _ChromeEval("document.getElementByID('" & ^ ERROR

Thanks,

-PD

 

 

Not getElementsById but getElementById, and maybe without $index.

Try this:

Func _ChromeObjSetValueById($objid, $value,  $timeout = 5)
    dim $response = ""
    $response = _ChromeEval("document.getElementById('" & $objid & "').value = '" & $value & "';", $timeout)
    SetError(@error)
    return $response
EndFunc

Share this post


Link to post
Share on other sites
JoeF

Are you still supporting this?

Microsoft Security Essentials says autoit_chrome_native_messaging_host_install.exe is a Trojan, Win32/Spursint.A 

What gives?

 

Share this post


Link to post
Share on other sites
JoeF

Hi Seangriffin,

I have done all these steps but when I test my script, chrome disables the Extension for AutoIt because it is not from Chrome web store. If says that uploading extension to chrome web store will resolve the issue.

Is there any other solution to it?

Thanks,

PD

http://superuser.com/questions/767286/re-enable-extensions-not-coming-from-chrome-web-store-on-chrome-v35-with-enhan

  1. Download the crx file and unpack the extension using your favorite decompresser. Take note of the directory where you placed it.
  2. Open the extension page, activate "Developer Mode"
  3. Click "Load unpacked extension..."
  4. Search trough your directory tree for the directory where you unpacked your extension and click OK. If your extension is called "my extension" then select "my extension" directory.

Advantages: You don't have to install anything else. Disadvantages: Chrome nags you to disable the extension each start up.

 

I've tried this with Chrome 48, it keeps the extension enabled, but pops up a dialog if you want to disable it or cancel.

 

The other option is to whitelist the extension with the Windows policy editor: https://productforums.google.com/forum/#!msg/chrome/9NlMAr6uEVc/ambkrcKpi1cJ

This doesn't bother you with a popup every time you start Chrome.

Edited by JoeF
  • Like 1

Share this post


Link to post
Share on other sites
JaysCogs

Hey, sorry, I hope this script is still being supported. I've followed the above directions, installed the autoit extension in developer mode, and allowed it access to file URL's, however running the first example script still doesn't work. Have things changed? I'm honestly not sure where to go from here.

Share this post


Link to post
Share on other sites
warcraft14115
On 11/2/2016 at 6:04 AM, JaysCogs said:

Hey, sorry, I hope this script is still being supported. I've followed the above directions, installed the autoit extension in developer mode, and allowed it access to file URL's, however running the first example script still doesn't work. Have things changed? I'm honestly not sure where to go from here.

 

it's very very long time ago :( i want some code the same

Share this post


Link to post
Share on other sites
darknezz21

I like many of you started out with ffload.au3 which would pixelsearch for a green pixel at the end of the loading bar in firefox 3. I got tired of running an outdated browser and moved over to chrome, it seems better these days anyway. Here is my setup..

 

Download Pace4Chrome extention, once in set it to color 2299DD and the loading to Centeratom, now we have a fairly reliable load indicator.

Here is your modified ffload function module below, feel free to critique my poor habits in a friendly manner.

Func _FfLoadWaitTime ($x, $y)
    Global $pop = 0
    While 1
       $pop = $pop + 1
        Sleep ( 0 )
    $loading = PixelGetColor ( $x, $y )
if $loading = 0x2299DD Then
       ;MsgBox(0, "loading detected", "blue loading started")
        ExitLoop
        ;Set the pop numbe below to what you want it to wait at untill it figures the load indicato didn't load, 900 is about 9seconds, i dunno why.
     elseif $pop = 900 Then
         ;MsgBox(0, "loading not detected", "first pop")
      ExitLoop
    EndIf
 WEnd

 While 1
       $pop = $pop + 1
        Sleep ( 0 )
    $loading = PixelGetColor ( $x, $y )
;if $loading <> 0x2299DD Then
   if Not ($loading == 0x2299DD) Then
      ;MsgBox(0, "loading detected", "blue loading ended")
      ExitLoop
  ;the pop below isn't even needed but i'm just posting this as it with debug msgbox's and all
  elseif $pop = 1400 Then
      ;MsgBox(0, "loading not detected", "second pop")

      ExitLoop
   EndIf
Wend

 EndFunc;==>_FfLoadWaitTime

Your cords to use when calling the function should be obvious but vary depending on you display res. Sometime the load indicator doesn't display, like 1 outs 25, so other is a pop to bypass if pixelseach doesn't find it's thing in x amount of time, default is 900 which is about 9 seconds on my machine, not sue why, would assume 9000 would be 9 seconds.

 

Anyway I think that's it, Hope some of you can use this.

Share this post


Link to post
Share on other sites
Fragan

Google Chrome won't let me activate the extension

Share this post


Link to post
Share on other sites
7121

I know this is probably an old thread but I wanted to point out to anyone that treks here that THIS UDF STILL WORKS AS OF CHROME 53.

For anyone wants to know how to get back on track or up and running, it's fairly simple but rather complex as well...I'm writing a guide because there some people who come here looking to find a way to automate Chrome for their workplace (like me) but can't get going because there aren't much answers as to if this might work or not. This UDF can work WITHOUT admin rights, it theoretically can if you tune the registry to CURRENT_USER.

There's THREE IMPORTANT components that come into play in order to make it work really well:

1. The Native Messaging Host (The Author called it  autoit_chrome_native_messaging_host). I simply call it the NMH.

2. The AutoIT Chome Extension

3. The Registry

FOR PEOPLE THAT NEED TO GET THIS UP ASAP:

1. INSTALL  autoit_chrome_native_messaging_host_install.exe

2. Install the chrome extension, the MESSAGING HOST should activate (please refer to the bottom as this extension is not fully working), you can tell in the little tray icon. THIS MEANS you are good to go and the host is awaiting instructions from the AUTOIT Script.

If it doesn't activate, something is wrong! It could be the registry, it could be way you set up your system, who knows. YOU will need to read further in order to figure where something went wrong.

3. To test, do: 

_ChromeEval("alert('hello world');")

 

FOR PEOPLE NOT GETTING THE CHROME EXTENSION TO WORK PROPERLY:

Chrome has stopped supporting third party or custom extensions for awhile now. This leads to the problem of having the extension not being able to work when you check mark ALLOW ACCESS TO FILE URLS. It can work without that but seangriffin seems to imply it would work much better if it had the ability to.  JoeF proposed the correct idea of extracting the CRX file (you can use anything: winZip, WinRar, 7zip), and placing the files in a folder. From there, get Chrome to go into developer mode ,and load that folder that you extracted into. This WILL break the NMH i guarantee you that! That's okay! WE CAN FIX IT EASILY. Go to the file of where the NHM is, which is AppData/Roaming/AutoIt/Chrome Native Messaging Host/. From there, you'll see there are two files. the autoit-chrome-native-messaging-host.exe and manifest.json. Open that manifest.json with notepad or whatever edit too. Now go back into your chrome and look at the ID of the unpacked extension that you loaded, it should give you an ID. YOU NEED TO TAKE THAT ID and replace it in the manifest json. It looks somewhat like this:

chrome-extension://nmocofiopaekephdbaeokkcnplpnenkg/

replace that green looking string with your ID given from Chrome. This is for security and everyone gets a different ID. If you want consistency, you will have to read further down because there is a way to make sure the same ID can always be used (This is useful portability or deployment). Now reload and the NHM should activate by itself and you'll see it as the little tray icon.

I'm gonna have to stop right here for now due to a time strain. It's a little late over here, so once i have time, i will update this guide some more for sure.

Spoiler

 

FOR PEOPLE THAT WANT TO KNOW IT WORKS (THIS WILL HELP RESOLVE ANY RUNNING ISSUES):

The Messaging Host installer installs the files into your AppData/Roaming/AutoIt/Chrome Native Messaging Host/ directory. The NMH nstaller also leaves a registry key in which the Autoit Chrome Extension can read its location and active the NHM from that particular directory.

So this is how it communicates:

First you load Chrome. Chrome will run that extension...

 

 

 

Edited by 7121

Share this post


Link to post
Share on other sites
Aphotic
On 9/29/2013 at 10:23 AM, seangriffin said:

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.

Python has now been replaced with AutoIT as the Native Messaging Host.

If this is the case can you please post the source Au3 for the native message host?

Thanks in advance!

 

Share this post


Link to post
Share on other sites
n3wbie

Is Udf Still Wroking

I tried extracting file and loading as packet

but still m not getting it working

please help me on this

chrome startup is working correctly but no other functions are working

some one please correct me if m doing something wrong or missing something important

Edited by n3wbie

Share this post


Link to post
Share on other sites
zuliasro

Quick HOW TO install AutoIT for Google Chrome.crx Chrome extension.

1, Download from here: https://docs.google.com/file/d/0B_6JmwNIIZ06enotRTVFNVdKOXM/edit?usp=sharing
2, Rename the file extension  from crx to zip (result will be: AutoIT for Google Chrome.zip)
3, Unzip the file in a folder
4, Open Chrome and navigate to the Extensions (chrome://extensions/)
5, Tick the "Developer mode"
6, Click to the "Load unpacked extension..." button and navigate to your previously unzipped folder

That's it!

Tested, working in Chrome Version 55.0.2883.87 m (64-bit)

  • Like 1

Share this post


Link to post
Share on other sites
fpic
On 1/23/2017 at 1:58 AM, zuliasro said:

Quick HOW TO install AutoIT for Google Chrome.crx Chrome extension.

1, Download from here: https://docs.google.com/file/d/0B_6JmwNIIZ06enotRTVFNVdKOXM/edit?usp=sharing
2, Rename the file extension  from crx to zip (result will be: AutoIT for Google Chrome.zip)
3, Unzip the file in a folder
4, Open Chrome and navigate to the Extensions (chrome://extensions/)
5, Tick the "Developer mode"
6, Click to the "Load unpacked extension..." button and navigate to your previously unzipped folder

That's it!

Tested, working in Chrome Version 55.0.2883.87 m (64-bit)

Step 3 not working.

I rename crx into zip, but 7zip, winzip, report corrupted file

Do you have another location to download it? The file on google sizes only 23k

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

    • kcvinu
      By kcvinu
      Hi all,
      I am playing with _GUICtrlButton_Create function. How can i change this button's (or the entire form's) font ?. The in-built GUICtrlSetFont function is not working even when i convert the control handle to control ID with _WinAPI_GetDlgCtrlID ( ) function.  Do i need to use CreateFont api finction and send WM_SETFONT message ? Or is there any other easy and safe ways to do this ?. Thanks in advance.
      Note : This window is created by CreateWindowEx function, not by GUICreate function. 
    • rudi
      By rudi
      Hello,
      usually I do Win automations, so I have no skills at all to handle HTML forms :-/
      The script to catch and syntax check  the required information from Excel is done.
      Now I'd like to automate the upload using this form, too:
       
      http://flashcardsdeluxe.com/flashcards/Upload.aspx
      What browser is easiest to do so? (IE, Chrome, FF) The Values $DeckCode, $DeckName, $DeckDefinition shall go to their HTML form fields finally "click" the button "upload flashcards" <table width="70%" class="cssCenter" border="0"> <tr> <td style="width: 1%">Deck&nbsp;Code</td> <td style="width: 100%"><input name="ctlDeckCode" type="text" id="ctlDeckCode" style="width:50%;" /> (no spaces allowed)</td> <td></td> </tr> <tr> <td style="width: 1%">Deck&nbsp;Name</td> <td style="width: 100%"><input name="ctlDeckName" type="text" id="ctlDeckName" style="width:50%;" /> (optional)</td> <td style="width: 1%" align="right"><input type="submit" name="ctlUpload" value="Upload Flashcards" id="ctlUpload" /></td> </tr> <tr> <td valign="top" style="padding-top: 5px" >Flashcard&nbsp;Text</td> <td colspan="2"><textarea name="ctlFlashcardText" rows="2" cols="20" id="ctlFlashcardText" style="height:280px;width:100%;"></textarea></td> </tr> </table> If someone kindly could jump in showing how to address just one of the input fields and how to "click" the "upload flashcards" button, I should be able to do the rest myself.
      TIA, Rudi.

    • TheWizEd
      By TheWizEd
      It seems AutoIt for Chrome is no longer working.  It's not in Google Store so not able to enable.  I can download the crx and drag to chrome but I can't figure out any way to enable the extension.
    • zxc3
      By zxc3
      Are there any examples of a script for Сhrome that allows you to check whether the information in the browser window has changed with a certain periodicity and signal this for 32-bit Windows.
    • okolaris
      By okolaris
      Hey everyone,
      I thought I might share my little Language UDF plus the more powerful SciTE Tool to ship Strings from SciTE into the xml file. While I haven't had the time to fully adapt the small UDF to one of the big XML-UDFs the so called "Language Transmitter" that basically writes the XML file for you runs mostly on "XML DOM wrapper (COM)" by eltorro. The Transmitter should work with other XML-Language-UDFs depending on their encoding.
       
      First let's start with the UDF, there are two functions of interest: _LangInit($sFilePath) and s($sString) As you will have guessed, _LangInit($sFilePath) is called once to initialize the UDF and s($sString) is used to receive the string to your key. Plain and simple.
      Now to the actual "new" part, the Language Transmitter. It basically allows you to transfer a selected String from SciTE into a xml file. While doing so it will scan for AutoIt variables, macros etc. and parse the string to fit StringFormat(). It then saves the formatted string in the xml file and returns the formatted call into SciTE. If the selected string is already defined it will directly parse the key into SciTE. To change the default output file, you can either edit the ini-file in the @ScriptDir of the LanguageTransmitter.exe or press Alt+A on empty space again and keep clicking cancel/no until the Transmitter let's you select the current output file. Standard output is strings.xml in the current opened AutoIt Script.
      Example:
      ; given the line: MsgBox(16, 'Error', 'Error message') ; select 'Error' run the Transmitter follow the instructions, repeat with 'Error message'. Outcome (e.g.): MsgBox(16, s('Error'), s('Error_msg')) ; Variables and Macro example: $sString = "Value: " & $iValue & @CRLF & 'Another value: '& $iValue2 ; Select the full string including all AutoIt variables and macros etc. in SciTE and press Alt+A (default) to run the LanguageTransmitter ; follow the instructions and it will then paste a formatted string like that into SciTE: $sVar = StringFormat(s('Key'), $iValue, $iValue2) ; the correlating xml entry should look like that: ; <string name="Key">Value: %s\r\nAnother value: %s</string> ; as you can see @CRLF has been replaced with \r\n as well. If you are working on a project and want to directly add a string to the xml file just start the Language Transmitter without selecting any text, enter your string and a key.
      SetUp/Installation
      Examples
      Since xml files are required all examples can be found in the zip file. There are two examples, one includes a language selection interface.
      Language File Checker
      I added a script to check whether the xml file contains all required strings or even unnecessary strings.
       
      Hope you like my little helper!
       
      UDF - LanguageSupport.zip
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.