Leaderboard
Popular Content
Showing content with the highest reputation on 03/10/2020 in all areas
-
PSPad4AutoIt3 (editor IDE)
Musashi and one other reacted to Professor_Bernd for a topic
Thanks for asking. Yes, there is a dark theme that can be applied: "PSPad dark". It was shipped with the latest PSPad version 5.0.4 (381), or can be found here: PSPad dark.zip In PSPad you can set up an own color scheme for each language (AutoIt, C++, Pascal, ...). In the main menu click on "Settings" / "Highlighter Settings". To choose a color scheme: In the dialog click on "AutoIt3" on the left side. The current color scheme for AutoIt3 will appear. Then you can choose one of the available themes. In the lower part of the dialog next to "Color Scheme" click on the arrow of the ComboBox and choose e.g. "PSPad dark". Then click on "Load" to load the theme, and click on "Apply". To create your own theme, you can set each color according to your wishes. Then just enter a name in the ComboBox, for example argumentum1, and click "Save". To adopt the colors of SciTE, you can assign each color in SciTE to a corresponding color in PSPad. In the file "...\PSPad4AutoIt3\Syntax\AutoIt3.ini" you can see what is associated with "ReservedWords" [Macro], "KeyWords" [Funktion], "KeyWords2" [Standard UDF's], "KeyWords3" [Keyword]. SciTE equivalents in the square brackets. I have created a theme "argumentum1 " argumentum1.zip based on your screenshot. This theme is not accurate, because I picked the colors from the screenshot. If you send me your SciTE scheme, I can adjust the colors more precisely. To import color schemes, just copy the desired color scheme file (e.g. "PSPad dark.ini") to the folder: "...\PSPad4AutoIt3\Colors\". After that you can select the imported theme in the highlighter dialog described above in "To choose a color scheme". To change colors for "LOG parser" and "Brackets": In the program settings there seem to be 3 colors which are not changed in the highlighter. ("Spell Check", "LOG parser" (error highlighting) and "Brackets"). To set these 3 colors, click on "Settings" / "Program Settings" in the main menu. In the dialog window click on "Colors" in the left area. Note: The program settings apply to all highlighters. Bernd.2 points -
Local $s = '<span>Final Result: Installation completed successfully with success code: (0x00000000), ' $s &= '"The operation completed successfully." (Elapsed time: 0 00:00:00).<BR></span>' $s = StringRegExpReplace($s, '.*(Final Result.*?)<.*', '$1') MsgBox(0, 'Result', $s) ; 1. [ .* ] run to first character wanted, to... ; 2. [ (Final Result.*?) ] capture any wanted character, to... ; 3. [ <.* ] finish from < to end of text document. ; 4. [ $1 ] output captured group.1 point
-
#include<array.au3> $str = fileread("test.txt") $a = StringRegExp($str , '(Installation .*?) with .*? \((.+?)\), \"(.+?\.)' , 3) _ArrayDisplay($a)1 point
-
Here's a quick & dirty example of one way that it could be done #include <Constants.au3> example() Func example() Const $MSG1 = '</span>Final Result: Installation completed successfully with success code: (0x00000000), "The operation completed successfully.' & @CRLF & '" (Elapsed time: 0 00:00:00).<BR></span>' Const $MSG2 = '</span>Final Result: Installation completed successfully with success code: (0x80070BC2), "The requested operation is successful. Changes will not be effective until the system is rebooted.' & @CRLF & '" (Elapsed time: 0 00:05:02).<BR></span>' Const $MSG3 = '</span>Final Result: Installation failed with error code: (0x80092004), "Cannot find object or property.' & @CRLF & '" (Elapsed time: 0 00:02:57).<BR></span>' ConsoleWrite(StringFormat("MSG1 successful = %s", IsInstallSuccessful($MSG1)) & @CRLF) ConsoleWrite(StringFormat("MSG1 reboot required? = %s", IsRebootRequired($MSG1)) & @CRLF) ConsoleWrite(StringFormat("MSG2 successful = %s", IsInstallSuccessful($MSG2)) & @CRLF) ConsoleWrite(StringFormat("MSG2 reboot required? = %s", IsRebootRequired($MSG2)) & @CRLF) ConsoleWrite(StringFormat("MSG3 successful = %s", IsInstallSuccessful($MSG3)) & @CRLF) ConsoleWrite(StringFormat("MSG3 reboot required? = %s", IsRebootRequired($MSG3)) & @CRLF) EndFunc Func IsInstallSuccessful($sMsg) Return StringRegExp($sMsg, "Final Result: Installation completed successfully") EndFunc Func IsRebootRequired($sMsg) Return StringRegExp($sMsg, "Final Result: Installation completed successfully.*?Changes will not be effective until the system is rebooted") EndFunc Output: MSG1 successful = 1 MSG1 reboot required? = 0 MSG2 successful = 1 MSG2 reboot required? = 1 MSG3 successful = 0 MSG3 reboot required? = 01 point
-
also try to have a look to the Assoc and Ftype console commands as explained here: https://superuser.com/questions/406985/programatically-associate-file-extensions-with-application-on-windows1 point
-
yes, .... sure, the createtable statement must be adapted accordingly to the input string got it, thanks1 point
-
You need to make sure that the table that is defined can handle the number of columns. #include <Constants.au3> #include <SQLite.au3> example() Func example() Const $SQLITE_EXE = "C:\Program Files\Sqlite\sqlite3.exe" ;<== Modify as necessary Const $TEMP_DB = "~temp.db" Const $TEMP_DATA = "~temp.txt" Const $IMPORT_SCRIPT = _ "DROP TABLE IF EXISTS items;" & @CRLF & _ "CREATE TABLE items (col1 TEXT COLLATE NOCASE, col2 INT);" & @CRLF & _ '.separator | ,' & @CRLF & _ ".import " & $TEMP_DATA & " items" & @CRLF & _ ".mode list" & @CRLF & _ "SELECT * FROM items;" Local $iReturnCode Local $sOutput ;Write temp data file If FileExists($TEMP_DATA) Then FileDelete($TEMP_DATA) FileWriteLine($TEMP_DATA, "January|1,February|2,March|3,April|4,May|5,June|6,July|7,August|8,September|9,October|10,November|11,December|12") ;Execute script (Creates temp db & table, imports data, outputs data) _SQLite_SQLiteExe($TEMP_DB, $IMPORT_SCRIPT, $sOutput, $SQLITE_EXE) If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "Error executing _SQLite_SQLiteExe - @error = " & @error) ;Display ouput ConsoleWrite($sOutput) ;Delete temp files If FileExists($TEMP_DATA) Then FileDelete($TEMP_DATA) If FileExists($TEMP_DB) Then FileDelete($TEMP_DB) EndFunc Output: January|1 February|2 March|3 April|4 May|5 June|6 July|7 August|8 September|9 October|10 November|11 December|121 point
-
thanks @TheXman for your script, interesting example on how to import from a file. My intent would still be not to use temporary files or "command line shell for SQLite", but to do everything instead with a "self contained" query. Also, when I wrote "(maybe even choosing the separator or even more than one separator?)" I meant not to be able to use a different separator, but to be able to use multiple separators at the same time (sorry for my poor English ) Testing your script I saw that it uses ".separator |:" to choose the separator. Reading at point 5 of this link https://sqlite.org/cli.html I see that the .separator is a "command to change the separator. For example, to change the separator to a comma and a space, you could do this:" .separator ", " It appears that more than one separator can be used simultaneously. I tried to put multiple separators into your script without success. which syntax should be used to put multiple separators? Thanks again for your post1 point
-
GUIListViewEx - BugFix Version 6 Apr 24
Musashi reacted to pixelsearch for a topic
Hi Melba23 Sorry for not answering earlier as I'm not on the site as often as I used to be. Here are the results of the tests I just did : * The 1st bug report you mentioned (which concerned columns) has been solved with your fix from last Sunday (March 8th) . Now when we run example 6, tick "Col" radio button, then insert/delete columns as much as we want, no error appears after all columns have beed deleted : problem solved. * The 2nd bug report (which concerned rows) is still there. Run example 6, click 7 times on Del => error at 7th click (i.e after the 6 rows have been correctly deleted, a 7th click when there are no more visible rows generate the following error) Tests have been done in a folder named "Nouveau dossier" containing 2 files only : GLVEx_Example_6.au3 and your last GUIListViewEx_Test.au3 (renamed GUIListViewEx.au3) Good luck & fingers crossed1 point -
In Windows 10 you can use: #include <StringConstants.au3> Opt("ExpandEnvStrings", 1) Local $iPDFDefault, $sPDFDefaultExt = RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice", "ProgId") Local $sPDFDefaultExe = RegRead("HKCR\" & $sPDFDefaultExt & "\shell\open\command", "") $sPDFDefaultExe = StringRegExp($sPDFDefaultExe, '^"(.+?)"', $STR_REGEXPARRAYMATCH)[0] ConsoleWrite("Prog ID: " & $sPDFDefaultExt & @CRLF & "Command: " & $sPDFDefaultExe & @CRLF) Normally I use PowerShell to export file associations from a configured machine. During image build we import them using PowerShell. Initially we used Group Policy to import the file associations xml file, however staff weren't able to change the associations, example if they were using Adobe Acrobat rather than Adobe Reader. If I do need to modify an extension I just export the "UserChoice" key above and use either Group Policy preferences or script to add the key to clients. We also use the following to stop Edge from hijacking file extensions, using NoOpenWith and NoStaticDefaultVerb (see : https://www.winhelponline.com/blog/edge-hijack-pdf-htm-associations/).1 point
-
Hello 1: With this you can get the program Id based in an extension Local Const $sCLSID_ApplicationAssociationRegistration = "{591209c7-767b-42b2-9fba-44ee4615f2c7}" Local Const $sIID_IApplicationAssociationRegistration = "{4e530b0a-e611-4c77-a3ac-9031d022281b}" Local Const $sTagIApplicationAssociationRegistration = "QueryCurrentDefault hresult(wstr;int;int;wstr*);" Local $oApplicationAssociationRegistration = ObjCreateInterface($sCLSID_ApplicationAssociationRegistration, $sIID_IApplicationAssociationRegistration, $sTagIApplicationAssociationRegistration) ConsoleWrite("IsObj($oApplicationAssociationRegistration): " & IsObj($oApplicationAssociationRegistration) & @CRLF) Local $sDefaultPDF="" $oApplicationAssociationRegistration.QueryCurrentDefault(".pdf", 0, 1, $sDefaultPDF) ConsoleWrite("$sDefaultPDF: " & $sDefaultPDF & @CRLF) 2: I can see Install path here HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Adobe\Acrobat Reader\DC\InstallPath 3: In windows 7 It's very easy to change default App but Windows 10 It's complex. I wrote a tool (not in AutoIt) to set an App as Default You can use it as base. You can check here. Saludos1 point
-
speed up order by int DESC, text ASC;
argumentum reacted to jchd for a topic
I have a lot of pans on the fire, many urgent and time-killing. I also start to experience issues have Chinese-only electronic components delivered due to COVID19. I'll try to code something when schedule allows.1 point -
PSPad4AutoIt3 (editor IDE)
argumentum reacted to Professor_Bernd for a topic
Reserved Sorry, I swapped this post with the one above.1 point -
PSPad4AutoIt3 (editor IDE)
Professor_Bernd reacted to argumentum for a topic
I use My fine tuned High Contrast theme to set the colors for my desktop. A dark mode has much less impact at the end of the day, than the common bright whites, all day, everywhere. So the dark coloring is important to me. The use of PSPad is interesting, as I also plan to do some HTML in AutoIt. Other than that, with the full SciTE distro. one can get at the AutoIt installer page, one can have a very specialized environment, that I personally prefer over an IDE, like ISN AutoIt Studio for example. ( tho I have not seen another in the wild ) So, I don't know. I don't have a reason to use another environment to code AutoIt. On the HTML unrelated note: I don't find an environment I feel comfortable in yet. I have the same opinion Alpine gave in the .de forum a while back, so, my, or anyone's use, or not use, should not be of consideration. There are things we do, because we find it beautiful. Very many use stuff that the coder is never thank or aware of, yet is useful ( hence beautiful ). And, thanks for sharing1 point -
Maybe this might work? The example below uses _SQLite_SQLiteExe to create a result set from a separated list. As you can see, I changed the separator from commas to colons just to show how easy it is to use a different separator, The import script does all of the work. If you want to change to separators, you just need to modify the first ".separator" line. If you want to modify the result set, you just need to modify the "select" statement. #include <Constants.au3> #include <SQLite.au3> example() Func example() Const $SQLITE_EXE = "C:\Program Files\Sqlite\sqlite3.exe" ;<== Modify as necessary Const $TEMP_DB = "~temp.db" Const $TEMP_DATA = "~temp.txt" Const $IMPORT_SCRIPT = _ "drop table if exists items;" & @CRLF & _ "create table items (item collate nocase);" & @CRLF & _ ".separator | :" & @CRLF & _ ".import " & $TEMP_DATA & " items" & @CRLF & _ ".separator | \n" & @CRLF & _ "select * from items;" Local $iReturnCode Local $sOutput ;Write temp data file If FileExists($TEMP_DATA) Then FileDelete($TEMP_DATA) FileWriteLine($TEMP_DATA, "January:February:March:April:May:June:July:August:September:October:November:December") ;Execute script (Creates temp db & table, imports data, outputs data) _SQLite_SQLiteExe($TEMP_DB, $IMPORT_SCRIPT, $sOutput, $SQLITE_EXE) If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "Error executing _SQLite_SQLiteExe - @error = " & @error) ;Display ouput ConsoleWrite($sOutput) ;Delete temp files If FileExists($TEMP_DATA) Then FileDelete($TEMP_DATA) If FileExists($TEMP_DB) Then FileDelete($TEMP_DB) EndFunc Output: January February March April May June July August September October November December1 point
-
PSPad4AutoIt3 (editor IDE)
argumentum reacted to Professor_Bernd for a topic
Choose a language for the PSPad interface To select a language for the PSPad interface, click on "Settings" / "Program Settings" in the main menu. In the settings dialog on the left side click on "Language". On the right side you can now choose between more than 40 languages. Associate file extensions ".au3" and ".ppr" (project files) with PSPad To associate file extensions with PSPad, click on "Settings" / "Program Settings" in the main menu. In the settings dialog on the left side click on "Registered File Types". On the right side, ".au3" and ".ppr" are already entered. Now click on the button "Register all". More file extensions can be added in the lower part of the dialog. In the text box at "Type" enter the desired file extension including the leading dot and click the button "Add New". Then click on the "Register all" button. Shortcuts (AutoIt related) To see a list with a selection of AutoIt related shortcuts, click on "Scripts" / "_AutoIt" / "_Tips and shortcuts" in the main menu. The ReadMe.txt is displayed in PSPad. Many of the AutoIt related shortcuts are listed there. Bernd.1 point -
@rm4453 Thank you for showing the interest, I am planning to start work on this project soon... just need to finish something more important in life and once that is finished I can finally dedicate time to my hobby projects again1 point
-
I really look forward to this, as this is a huge thing for me ease of transition wise to Linux... my go to programming language is always AutoIt... If It can be done in a 100 languages and AutoIt is one I go with it, as it's so easy to proto-type fast as well as get support when needed in a timely manner... as well as having the most experience in it!1 point
-
How to enumerate controls for Dropbox
seadoggie01 reacted to argumentum for a topic
..would you care to try Syncthing ? I like it better.1 point -
Look in my signature. To be more accurate1 point
-
Minimize all windows but AU3 script
Ebola57 reacted to seadoggie01 for a topic
Seems that you need a small sleep in your script... WinMinimizeAll() Sleep(100) WinSetState($hWnd, "", @SW_RESTORE)1 point -
Problem with IE error handling
Ebola57 reacted to seadoggie01 for a topic
You need to set up a COM Error handler... take a look at the help page for ObjEvent1 point -
I can confirm that it is working with french keyboard. For example é is vk "BF". To know what vk is for each char, you can use _WinAPI_SetWindowsHookEx example found in the help file.1 point
-
My fine tuned High Contrast theme
Professor_Bernd reacted to argumentum for a file
Version 0.2019.12.12
789 downloads
My fine tuned High Contrast theme, came from the need of a better "Dark Mode", that is still not there yet. Okay, let's use a "High Contrast Theme", but then again, the available colors to tweak are quite limited. So I'm like But since we can code: Behold !, an expanded theme color chooser 😁 And none of the changes, add or remove anything to the OS. Is just color tweaking. ...is incomplete as far as I would like it to be but, fully functional at this stage. ( I'll continue as time permits )1 point -
You need to wait for Run to end before reading the stream. Look help file, it has examples about this. Second you could do the ZIP thing within the Shell.Application object which would give you somewhat more control and you could implement on any Windows machine without outside application. But I doubt you will like this suggestion0 points