Leaderboard
Popular Content
Showing content with the highest reputation on 07/08/2018 in all areas
-
version: 2.0.0 So many new changes Most notably, the change of Github repository. This project, now has it very own Github repository, for less obscurity with issues and releases.4 points
-
CalibBrowser - Multi-faceted viewer for calibre
coffeeturtle and one other reacted to TheSaint for a topic
Only early days at this point, but I have been pondering such a program for a while. As good as calibre is (thank you Kovid Goyal), which is a great and wonderful ebook suite of tools and a fair database, it does have its limitations. One of which, is how it deals with multiple libraries, another is the views you get. CalibBrowser will seek to address those. What CalibBrowser is not going to be, is an editor for existing calibre libraries. That will be left up to calibre, which is very much needed still, and covers many aspects I will never look at. Unlike calibre, which is quite a complex program, CalibBrowser also seeks to be simple. It is mainly a viewer, at this point, but will later be able to create its own libraries. However, it does not and will not export them to calibre, especially as calibre employs a far different method and structure to what CalibBrowser will employ. When CalibBrowser starts, it looks for calibre executables and the main Calibre Library. Whatever isn't found, you get prompted for with a browse option. A calibre library, is a set of ebook folders (Author\Ebooks) and a database file, always named metadata.db, and which causes an issue when it comes to multiple libraries, but makes life a bit easier when reconstructing any corrupted libraries. However, there are better ways to deal with that, as my program will show. The metadata.db file is an SQL database, so I am having a learning curve right now, as I have only ever dealt with an SQL database previously, codewise, when I created my INItoSQL program some time last year, as an exercise to prove a point. At the moment, things are pretty basic, and not everything works 100%. Here is a screenshot, to give an idea of it, but keep in mind, I intend to expand the current GUI for other stuff I will be adding. Older Screenshots Gawd, I just noticed the '3|7' in the Book Input field (original screenshot). I was using that during troubleshooting for the multiple images scrolling and forgot to disable it ... not that it impacts anything. When it comes to maths, I struggle a bit, especially when tired. Right scrolling was easy, with a continuous loop, was easy to implement. Left scrolling was significantly harder for my poor brain ... until I realized I needed to see them as Min and Max. As you can see the program is usable, and all the buttons, aside from the Program Information one, work. You can even load different calibre libraries, and even reload after making changes to one with calibre. The calibre program does not need to be running, even to view an ebook in the Calibre Reader. The combo selector for a library and the ADD button are only temporarily placed where they are, until I expand the GUI. My intention at this point, is to add another five thumbnail images, directly below existing. Currently they aren't clickable, but I may add that. Here is another screenshot, of what you see when you click the larger Cover image. If you want to have a play with the program as is, then you will need to also get the 'sqlite3.dll' file from some online source. When CalibBrowser starts successfully with the selected calibre library, it copies its metadata.db file to a sub-folder of the program called 'Backups'. It also creates a sub-folder in that, based on the library name, to house it. That copied file, is the one the program uses, though it does not even edit that, and file modification is checked every time the program starts with a particular library, or when you Reload or select a library. If the original source file has been modified, then the program copy is overwritten. The Reload Database button does nothing, if there is no change detected, and reports such. Place the required 'sqlite3.dll' file in the CalibBrowser root folder. Download includes source files (sqlite3.dll excepted). Also required of course, is an install of calibre, plus some ebooks in a created library - Calibre Library is the default when you first add ebooks to calibre. The Mobile Read Forums, is a great source for all things ebook, and calibre can be found there in the E-Book Software section. CalibBrowser.zip 1.34 MB - Upload 4 (previous downloads: 1 + 12 + 5 + 282) CalibBrowser (new).zip My apologies for the program being created in AutoIt v3.3.0.0. It is the first one I have done in a while, with an older AutoIt version. Basically my Win 7 Netbook, which has a current version of AutoIt, was busy and is always busy doing something, and not suitable for doing big projects for several reasons. My older but more powerful Win XP Laptop, has a better programming environment, better computer chair (most important for my knees etc), better external monitor (wider and newish), full size external keyboard & mouse, and a great suite of setup tools to assist me. I run several older versions of AutoIt already on my Laptop, but haven't yet determined what I need to adjust to add a current version of AutoIt to the mix. This also applies to my hugely beneficial Toolbar For Any program (one of those tools), which I constantly use with SciTE. At some point, when finished, I may update the program to the current AutoIt version ... especially as I believe I am now proficient enough to do so, having become quite familiar with it in the last year or so, making many programs with it. Enjoy!2 points -
7/8/2018: Uploaded a new SciTe4AutoIt3.exe v18.708.1148.0 installer. It has been over a year since the last update of the full SciTE4AutoIt3 installer whch mainly had to do with the fact that Neil was moving toward v4 of SciTE and I wanted to wait for a stable version. Any help with testing this version before general release is appreciated. Also any feedback is welcome in caseI missed something or suggestions for improvement before releasing. ==> SciTE4AutoIt3 v18.708.1148.0 Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 8-7-2018 *** Merged the SciTE v 4.1.0 by Neil Hodgson with our own version of SciTE. (Jos) This is a major change from the previous version so ensure you update all files including LUA or else you will get errors! - SciLexer au3: Fixed issues with nested CommentBlocks not always showing the correct color. - SciLexer au3: Change any line starting with # and no recognised keyword to be shown with the Pre-Processor in stead of default. - Changed Shortcut for AU3INFO to Ctrl+Shift+F6. - Moved the session restore logic for (save.session.advanced=1)into SciTE in stead of LoadSession.lua as that was clearing the recent files list of the last session when opening a file by double cliking it. This is fixed with this change. Default remains 0 so when a file is double clicked the last session isn't restored unless you add this to SciTEuser.properties: "save.session.advanced=1" - updated Tools.lua replacing [s%] with [ /t] to avoid empty lines being stripped by those functions. (Thanks Enyby) *** Updated AutoIt3Wrapper v18.708.1148.0 (Jos) - 17.224.935.1 Added /autoit3dir to au3stripper commandline, when provided to AutoIt3Wrapper., to ensure the included files are for the correct AutoIt3 directory - 17.224.935.2 Added directives: #AutoIt3Wrapper_Res_CompanyName= ;Company field #AutoIt3Wrapper_Res_LegalTrademarks= ;Trademark field - 17.224.935.5 Fixed Versioning when files contain backets -> () - 17.224.935.6 Added support for : #AutoIt3Wrapper_Au3stripper_Stop_OnError= ;(Y/N) Continue/Stop on Warnings.(Default=N) - 17.224.935.7 added INI support for: [Other] Au3Stripper_Stop_OnError=n - 17.224.935.10 Minor changes in console messages - 17.224.935.11 Modifications from JPM: - add #AutpIt3Wrapper_Res_Cursor_Add - "clean" a little bit AutoIt3Wrapper.au3 *** Updated Au3Stripper v18.708.1148.0 (Jos) - 17.224.935.1 Fixed crash when an include file contains longer record than 4096 characters. - 17.224.935.2 Changed /rsln to replace @ScriptLineNumber in the Master script with "XXX/YYY". XXX is the master script linenumber, YYY is the Merged script linenumber. - 17.224.935.3 Fixed issue detecting #cs #ce when a space was missing after the directive. - 17.224.935.4 Changed Close/Open logic for Tracelog to (hopefully) avoid the hardcrash. - 17.224.935.5 improved speed avoiding rereading include files to determine the max rec len. - 17.224.935.6 improved speed by re-coding the check for long records. - 17.224.935.7 Made sure the returncode is the highest from all iterations in stead of the last iteration. - 17.224.935.8 fix for reported bug: https://www.autoitscript.com/trac/autoit/ticket/3623#comment:4 - 17.224.935.9 added support for #autoit3wrapper_autoit3dir - 17.224.935.10 Fixed support for #autoit3wrapper_autoit3dir when followed by linecomment Stop processing when include file isn't found. - 18.624.1847.1 strip the leading and trailing double quotes from the autoit3dir directive to avoid an error when they are specified. - 18.624.1847.2 Fixed Hardcrash in the Include logic - 18.624.1847.3 Fixed Hardcrash in Func stripping logic by enlarging the base table size - 18.702.1556.1 Fixed regression bug with the Translate option. - 18.703.1808.2 Fixed regression bug with the Stripping FUNC logic for the first found FUNC. *** Updated SciTEConfig v18.708.1148.0 (Jos) - 17.224.935.1 No updates *** Updated Tidy v18.708.1148.0 (Jos) - 17.224.935.1 Added option to copy comments from #CS to #CE. Default is to copy the comments. Added Tidy Parameters: /Skip_CE_Comment or /scec will skip this copy action Added INI option: * * * Add comment to #CE/#CommentEnd and make it the same as the #CS/CommentStart Comments. ce_comment=1 - 17.224.935.2 Fix issue with Copy comments on comment start - end - 17.224.935.4 Fix another issue with Copy comments on comment start - end -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the online documentation for an overview of all extra's you get with this installer.1 point
-
Multiple coordinates in varriable
FrancescoDiMuro reacted to orbs for a topic
the simplest approach would be to use ReDim to add another row to your 2-column array, then store the new mouse coordinates in the new row.1 point -
WebDriver UDF - Help & Support
PoojaKrishna reacted to Danyfirex for a topic
Hello. Here are two functions that we will allow us to highlight the element(s) we're using. ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __WD_HighlightElement ; Description ...: ; Syntax ........: __WD_HighlightElement($sSession, $sElement[, $iMethod = 1]) ; Parameters ....: $sSession - Session ID from _WDCreateSession ; $sElement - Element ID from _WDFindElement ; $iMethod - [optional] an integer value. Default is 1. ; 1=style -> Highlight border dotted red ; 2=style -> Highlight yellow rounded box ; 3=style -> Highlight yellow rounded box + border dotted red ; Return values .: Success - True ; Failure - False ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __WD_HighlightElement($sSession, $sElement, $iMethod = 1) Local Const $aMethod[] = ["border: 2px dotted red", _ "background: #FFFF66; border-radius: 5px; padding-left: 3px;", _ "border:2px dotted red;background: #FFFF66; border-radius: 5px; padding-left: 3px;"] If $iMethod < 1 Or $iMethod > 3 Then $iMethod = 1 Local $sJsonElement = '{"element-6066-11e4-a52e-4f735466cecf":"' & $sElement & '"}' Local $sResponse = _WD_ExecuteScript($sSession, "arguments[0].style='" & $aMethod[$iMethod - 1] & "'; return true;", $sJsonElement) Local $sJSON = Json_Decode($sResponse) Local $sResult = Json_Get($sJSON, "[value]") Return ($sResult = "true" ? SetError(0, 0, $sResult) : SetError(1, 0, False)) EndFunc ;==>__WD_HighlightElement ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __WD_HighlightElements ; Description ...: ; Syntax ........: __WD_HighlightElements($sSession, $aElements[, $iMethod = 1]) ; Parameters ....: $sSession - Session ID from _WDCreateSession ; $aElements - an array of Elements ID from _WDFindElement ; $iMethod - [optional] an integer value. Default is 1. ; 1=style -> Highlight border dotted red ; 2=style -> Highlight yellow rounded box ; 3=style -> Highlight yellow rounded box + border dotted red ; Return values .: Success - True ; Failure - False ; @Extended Number of Highlighted Elements ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __WD_HighlightElements($sSession, $aElements, $iMethod = 1) Local $iHighlightedElements = 0 For $i = 0 To UBound($aElements) - 1 $iHighlightedElements += (__WD_HighlightElement($sSession, $aElements[$i], $iMethod) = True ? 1 : 0) Next Return ($iHighlightedElements > 0 ? SetError(0, $iHighlightedElements, True) : SetError(1, 0, False)) EndFunc ;==>__WD_HighlightElements How to use: _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "http://google.com") Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='hplogo']") __WD_HighlightElement($sSession, $sElement) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@name='btnK']") __WD_HighlightElement($sSession, $sElement,2) Local $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@class='gb_P']", "", True) __WD_HighlightElements($sSession, $aElements,3) Sleep(10000) _WD_DeleteSession($sSession) _WD_Shutdown() Preview: Saludos1 point -
Ooops yeah my mistake. Thanks for noticing ^^ i will change that immediately.1 point
-
#include <Array.au3> #include <Excel.au3> Local $aResults[0][6] Local $sFilePath = @ScriptDir & "\TestExcel.xlsx" Local $oExcel = _Excel_Open() Local $oWorkBook = _Excel_BookOpen($oExcel, $sFilePath) Local $oWorkBook = _Excel_BookAttach($sFilePath) $iSheets = $oWorkBook.Sheets.Count For $i = 1 To $iSheets $aResult = _Excel_RangeFind($oWorkBook, "Ahmed", $oWorkBook.Sheets($i).Range("C:C")) If UBound($aResult) > 0 Then _ArrayAdd($aResults, $aResult) Next _ArrayDisplay($aResults) Just loop through the sheets1 point
-
I meant that = is double-headed in AutoIt and was refering to C/C++ or other == The parser isn't confused by = as this show (fails too) ConsoleWrite($aArray[1 ? 1 : 2])1 point
-
I beg to differ. In the case at hand the bold red part is an expression which must be evaluated like any other expression (this fails): ConsoleWrite($aArray[$aArray[0] = "Foo" ? 1 : 2] & @CRLF) but this bold red expression is correctly interpreted in a different context (this works): ConsoleWrite($aArray[0] = "Foo" ? 1 : 2) ConsoleWrite(@CRLF) If the interpretor would interpret $aArray[0] = "Foo" separately, it wouldn't see an assignment but an equality test (which the first part of a ternary actually is). And indeed this is what happens in (works): ConsoleWrite($aArray[$aArray[0] = "Foo"] & @CRLF) The result of such a test is (here) the boolean True, so the inirial bold red expression would then become ConsoleWrite($aArray[True ? 1 : 2] & @CRLF) But this bold now green expression isn't evaluated correctly either in this context. Yet the same expression is correctly evaluated in another context: ConsoleWrite(True ? 1 : 2) ConsoleWrite(@CRLF) Hopefully AutoIt is meant to have an almost context-free grammar (we have no == operator) but this example demonstrates that <expr> isn't parsed the same in Function(<expr>) and Function($a[<expr>]) This is why I stand behind my statement that it's a bug. I called it minor because it's dead easy to work around, but bugs in expression parsers are fundamental to any language. A parser MUST be consistent and psychorigid. The advice in help to enclose ternary expressions in () arose mostly because newbies tend to write things like ConsoleWrite($x = "Three" ? 3 : 0 & @CRLF) and be surprised by the outcome.1 point
-
Bug: Ternary expression inside square brackets malfunctioning
JLogan3o13 reacted to Melba23 for a topic
The Dcoder, Really? Let us look at the code: ConsoleWrite($aArray[$aArray[0] = "Foo" ? 1 : 2] & @CRLF) ; The ConsoleWrite is fine, so we get $aArray[$aArray[0] = "Foo" ? 1 : 2] ; Now AutoIt looks at this code - there are no parentheses to force prior evaluation so it proceeds linearly ; It sees an array element with the content of another array element as index - no problems there ; but then it sees an assignment operator and so thinks you want assign a value to that array element ; But you have not closed the array element definition and so you get an error ; Using parentheses to force the ternary expression to be evaluated first removes this ambiguity Thus my remark about "poor coding syntax" - do not expect a computer to always think the way you do, make the priority of the elements within an expression absolutely clear. Another good example is using parentheses to clearly define the scope of a Not operator, which often catches out the unwary. I hope the above shows why the interpreter does not do what you think it should - it is actually being quite logical, it is up to you as the coder to clarify your intentions. And given the possible complexity of many ternary expressions, I think expecting AutoIt to recognise every possible case is asking rather too much. There must be a line drawn between looking for obvious errors and having massively bloated code to cover "every" case - which of course will never be completely watertight as humans are far too ingenious! So I reiterate my opinion that this is not a bug but an example of poor coding syntax where what appears logical to the coder is not actually seen as such by the interpreter. It is up to the coder to make his intentions clear - and using parentheses to force prior evaluation is a good example. As a matter of fact I always enclose the separate elements of a ternary expression in parentheses as well, so my version would read: ConsoleWrite($aArray[(($aArray[0] = "Foo") ? (1) : (2))] & @CRLF) M231 point -
IIRC it was intended. The rewritten UDF should be compatible with the old one. @error is only set when there is a real error. Means: Missing or invalid parameters, error returned by an Excels COM method ... The result of a successful search operation can be everything from 0 to n hits. The Excel method does not return an error when nothing was found, so that's why @error doesn't get set but an empty array gets returned by _Excel_RangeFind.1 point
-
Not sure if it was intended this way or its a bug (@water will know) but it returns an empty array when no results are found and the @error is set to 0, which means you would have to use something like Ubound($aResult) and check if it equals 0 then no items were found, see example below. Just out of curiosity which version of Office are you using, I'm using Microsoft Office Pro Plus 2016, I'm sure that @error worked on 2013/2007 or maybe my memory is a bit foggy. #include <Array.au3> #include <Excel.au3> Local $sFilePath = @ScriptDir & "\TestExcel.xlsx" Local $oExcel = _Excel_Open() Local $oWorkBook = _Excel_BookOpen($oExcel, $sFilePath) Local $oWorkBook = _Excel_BookAttach($sFilePath) $aResult = _Excel_RangeFind($oWorkBook, "Ahmed", $oWorkBook.Sheets("Sheet2").UsedRange) If UBound($aResult) = 0 Then MsgBox(0, "Excel Result", "No results were found") Else MsgBox(4096, "Excel Result", "Sheet = " & $aResult[0][0] & @CRLF & _ "Cell Location = " & $aResult[0][2] & @CRLF & _ "Cell Value = " & $aResult[0][3]) EndIf1 point