(Potential) Ebook Database plugin & stand-alone program & database for AZW file title, author, date, publisher, etc query.

(For recent updates to the Dropbox, see that section at end of this file)

(v6.8) Added a RENAME IMAGE FILE right-click list menu option and slide-out panel (for helping with missing Kindle covers on your device).

(v6.7) Due to an elusive bug, that causes fields for an entry, to gain the previous entry detail (file name excepted), two more right-click options for the database list have been added in the 'Selected Entry' menu entry. These are 'View Stored' and 'Recover'.

(v6.6) Implemented a fix for the possibility of a pipe character existing in a database ebook entry, along with a replacement of curly for square brackets. This fixes related INI and List issues.

(v6.5) Added a calibre library check to open correct folder after adding to calibre. Added a right-click List option 'Selected Entry -> Get Detail', to obtain information about an ebook from my companion program 'KindEbook Wishlist' or online via Calibre. Count on the Taskbar icon should now be correct when adding to Calibre.

(v6.4) Improved and added to List right-click menu options. Attempt made to deal with an auto selection bug when auto updating. 'Restore Latest' and 'Selected Entry - Undo Update' right-click List menu options added.

(v6.3) Current default library folder is now detected on demand, from calibre settings.

(v6.2) Improved & Expanded the search options (FIND and SHOW). SHOW button will now search the whole database, if the List is empty, and leading/trailing wild card asterisk can be used. FIND button now advises etc if List is empty.

(v6.1) When using the GET ALL UNLISTED process, status is now displayed in the Title field instead of using Splashes, and the Database window is restored sooner. The open selected entry in Wordpad etc, has now been updated to deal with KFX-ZIP files, viewing content of the metadata file instead.

(v6.0) Bugfix for blank Publisher automation option. If an entry is removed using the right-click UP button option, then that entry line is now colored Red, and updating with that button will now fully restore the entry and line color (Status excepted). During an adding to Calibre, the total count and currently processing number might be displayed in the program title (dependent on settings scenario). Splash have been replaced by big red text for loading and sorting, with additional progress indication. Due to a limitation of INI files, the method of reading section names has been changed. Minor display bugfix.

(v5.9) When changing Author name to Various, the original is saved and can be restored using that (UP button) right-click option. Improvements made to the 'GET ALL UNLISTED' button process, including visual and some automated replacements or fixes (see the 'Settings' button on the SETUP window, if you want to change any). Column width BUGFIX for Prior.

(v5.8) BUGFIX for adding any missing 'kfx-zip' file to Calibre. Opening the 'My Kindle Content' folder, via button with CTRL held down, will now present a program Close query. Button added (at top) for opening the folder containing the selected ebook.

(v5.7) BUGFIX for arrow buttons right-click option - 'Enable for Show Status'. The SHOW button now displays FOUND as the selected list when a result is returned. The FIND process now notifies if one match only on subsequent button clicks. UP and DOWN arrows now cycle around last to first entry and vice-a-versa. ON TOP button relocated and a HOME button added (same as using HOME key to jump to first entry). CTRL with HOME button selects the last entry on list (same as using END key). Clicking a column header while SHIFT is held down, selects the first entry on the second half of the list.

(v5.6) BUGFIX for non KFX file when using GET ALL UNLISTED button. Disabling controls during that button process, was overlooked, but now implemented. Added a 'Clear Selected Entry' right-click option to the UP button (as Delete does not remove from the List, just the database). A deleted entry is not automatically pruned from the Latest list, until you use the PRIOR button. Also added a 'Clear ALL Entries' right-click option. Improvements to other elements, including File input field and Program Information dialog.

(v5.5) Major Update. Ebook Database window has been widened for the addition of buttons matching many of the right-click List options. Some other buttons have been changed and some more added, with the program now featuring an extra streamlined (faster) method to add all unlisted ebooks from the 'My Kindle Content' folder, to the database and list, where they can then be checked and modified at need (or if any not wanted, removed). A bunch of other 'easier use' improvements have also occurred (i.e. see Setup window etc).

(v5.2) Added an ability to show previous additions (from newest to oldest). Implemented a 'Free' assignment list option as companion to 'Paid' items, plus an 'Unassigned' option. NOTE - A 'Free' item is for an ebook that was free, but where you have 'Paid' ebooks for that author too (so a different scenario to an unrelated 'Freebie'). To unassign an ebook from any list, you now need to use the 'Unassign' right-click option. You can display the 'Paid' list with or without (using CTRL) including 'Free' items. 'Free' and 'Unassigned' ebooks can also be shown independently.

(v5.1) A Query has been added for sorting, due to sort time with a large list and chance of accidental column click with first entry selection. 'Show Status Of All' option is now available in 'Latest' mode. Minor improvements. Added a 'Color Legend' right-click option.

(v5.0) Bugfix for sorting the Latest. Improved personal usage of Excel code for me. Added a 'Prune Latest' right-click option.

(v4.9) Just a simple update to a new way of doing some elements. The files 'Dropbox.exe' and 'Registry.a3x' (formerly Registry.au3), are now embedded in 'AZWPlug.exe', and extracted if missing or updated.

(v4.8) Dropbox updated to v2.9 (see History.txt). #RequireAdmin implemented in secondary script for Registry modifications. Better optional support for KFX. Made some changes to UP button right-click menu entries, including adding 3 new ones.

(v4.7) A complex update, with some support added for KFX files (i.e. KFX-ZIP). 'NO' is now the default button choice for running the Dropbox. Dropbox updated to v2.8, so please look at that section below for important details. BUGFIX for GUISetState.

(v4.6) More right-click options for the Listview have been added, that deal with the new 'Latest' list feature. Every time a new ebook is added to the database, it is also added to the 'Latest' list, to allow recalling what was just added. When add/removing a Status to an ebook, that entry is now de-selected to allow the line color to show more easily. If entries exist on the 'Add To Calibre' list, then the total number is now displayed as part of the program window's title text.

(v4.5) Another right-click option for the Listview has been added, which is for Saving the current Listed entries to a text file, delimited by ' :: ' (Publisher and Date excepted).

(v4.4) One more right-click option for the Listview has been added (Special), which is also a new LOAD option. Program folder button added to Setup window. Slickness has been added to the 'Show Status Of All' process.

(v4.3) Four more right-click options for the Listview have been added (Classic, Comic, Non-Fiction, Show Status For All). Navigation arrow button for UP and DOWN with the List items, has one more right-click option (Enable for CLASSIC). Bugfixes for 'Check Status' and arrow button focus (with colored surround). 'About' dialog has been updated.

(v4.2) The black LOAD label if clicked, will load the currently selected list. 'Paid' and 'Freebie' can now be cleared by reselecting, and when set, show different colored lines (orange for Freebie, green for Paid), that are temporary only (cleared by sort/loading). Two more right-click options for the Listview have been added (Check, About). Navigation arrow button for UP and DOWN with the List items, has two more right-click options, for enabling that button to be used to set 'Paid' or 'Freebie' (then move to next item).

(v4.1) LOAD button has been changed to LOAD the selected List option (Full, Paid, Free), with 'Paid' and 'Freebie' right-click menu options added for the Listview, to assign a selected ebook as either 'Paid' or 'Free'. 'Paid' is the default if nothing assigned.

(v4.0) Source ebook file can now be checked using Calibre's ebook-meta.exe program file, if calibre is installed and set in AZWPlug. This means automation is full, for detecting Title and Author etc, and requires minimal user editing. The dropbox has new features to compliment this, and now has the ability to jump to a specific number on the unlisted list.

(v3.9) The 'Ebook Display' window renamed to 'Ebook Database'. Added a 'Background Colors' option to the SETUP window for the other two windows (Lists & Input fields).

(v3.8) Improvements added, mostly to the Dropbox. Dropbox has some more handy right-click options (PASTE and FIND). FIND can be used to find missing ebooks from the database, that exist in the 'My Kindle Content' folder, giving an option to SCAN and ADD if desired. If PASTE is used with the full path of an ebook (AZW or MOBI), then ebooks can be added into the database that way, with SCAN. More foreign character fixes. NOTE - FIND can be used instead of Drag & Drop, so may prove to be a handy replacement process for that.

(v3.7) Removed the CTRL feature from the OPEN button, and assigned it to the new NEXT button. Some elements resized & relocated to accommodate this change. A READ button has been added to 'Ebook Display' window, allowing opening the selected ebook file in either Notepad or Wordpad or 'Other' read program. Added this 'Other' read program option, which is selectable on the Setup window. Added a 'Delete Selected Entry' right-click option to the UP button. Added a Replacement process for foreign characters at the scan stage, to hopefully avoid some text being skipped etc in Methods 2, 3 & 4. NOTE - For the sake of simplicity, the program does not accept accented characters (it replaces them with the closest norm). This has no impact on calibre, only the AZWPlug database listings.

(v3.6) Program Information on 'Results Selector' window has been updated. The OPEN button with CTRL held down, will run the next Method, instead of opening the chosen file. Query about returning previous values, after manually running a Method, can now be avoided by enabling the left checkbox (this means they will be automatically returned). Added more error checking etc.

(v3.5) Author and Title buttons swapped position on the 'Results Selector' window. Any pipe (|) characters found, are now replaced by space dash space. UP (Update) button on the 'Ebook Display' window, has been slightly increased in size. RESTORE button has changed to a FIX ALL button, until it or one of the other three buttons have been used. The FIX ALL button applies the processes of the first three buttons, in order from left to right.

(v3.4) Big changes to the 'Results Selector' window ... rearranging, resizing and adding a few things. Added a left TRIM button for Publisher, and ADD button for Author. Extra names for author field can now be added with a selection and click. The enlarged blue label now displays 'off' text, to indicate opening the 'Ebook Display' viewer is not going to happen when 'Results Selector' window is closed (you can still toggle it by clicking that label). Some buttons have been relocated, to better follow the left to right then down usage.

(v3.3) Added run options for my UpdateFromOPF program. Made some improvements to the Scan (ADD) process results. Added a Splash for 'UP' and 'Add To' button processes.

(v3.2) Some program titles changed from Calibre to CalibreDB, and a 'Run CalibreDB With List options' section added to the 'Setup' window. These new options (Start, Open, Close) allow for greater support & flexibility, especially with my other related programs and new ways of doing things.

(v3.1) Improved the Dropbox to now accept an ebook folder, and extract the AZW or MOBI file from that. A right-click context menu entry, 'Open the Kindle Content folder', has been added to the dropbox field. 'DROP BOX' button query dialog improved.

(v3.0) While you can still select the scan method on the Results Selector window, any selection made there does not now update the default method setting, which can only be permanently changed on the Database window via the Settings dialog. Added a Confirmation Query dialog when electing to clear the calibre ADD List. The VIEW the ADD List dialog now also displays a count of all items, in the dialog title. When clicking the PUBLISHER button on the Results Selector window with CTRL held down, it now toggles between clearing the current value and the default value of 'unknown or self'. Holding down SHIFT instead, sets the default value of 'unknown or self' regardless. Added some more error checking.

(v2.9) Buttons etc immediately below the main GUI list, have been modified and some made bigger, to accomodate the new 'DROP BOX' button. The new 'DROP BOX' feature allows faster & easier adding of ebooks to be scanned & added, via a floating dropbox, instead of the Windows right-click context menu 'Use Scan Ebook' entry. All cOntrols are now disabled during a LOAD or SORT and then re-enabled afterward (when Slicker Method is not set).

(v2.8) Database list can now be set not to display when starting that window, plus a LOAD button added to load that list when desired. CTRL used with the open Kindle Content folder button, will now close the program. If CTRL used when selecting the MODE on the Results window, it will just save the setting without making changes to existing results. Option added for slicker loading of list, plus alternate list lines are now pale pink. Two find options added for the Author and Title, with FIND jumping to each entry found and SHOW just displaying all found.

(v2.7) Added a DEL (remove) button to results window, plus a 4th method to get ebook detail.

(v2.6) Added improvements & bugfix for changing the default folder for ebooks (some elements were not working if no longer in the standard default location in My Documents).

(v2.5) Added support for an ebook being stored in first sub-folder (file name derived) of the default 'My Kindle Content' folder on PC. Browsing to set default ebook folder, has been added to SETUP window, along with an Info report button. Minor bugfix for browsing.

(v2.4) Added an ON TOP toggle button to top of Display window. Last ebook entry is now automatically selected on the Display window when location is not specified. Holding CTRL when clicking the UP/DOWN arrow at first or last entry jumps to the other. Implemented a personal EXCEL jump facility.

(v2.3) Added another Registry entry to just get ebook detail if in database.

(v2.2) Registry entry now made optional for public consumption. Setup button is now enabled all the time. Added a restore program window facility if already running, plus various error messages and a timeout & rewrite for run advice.

(v2.1) Added another Guess Method (with less automation accuracy, but increases data returned for selection). Methods can now be used on Display window to reload the ebook file, in case of missing data. Colored button can now be clicked to toggle Database display Mode. Opening the trimmed file is now via a checkbox indicator.

(v2.0) New (Guess) Method added as option for determining Ebook details. Trim button added for Title. CTRL allows the adding of more Author names. Colored Label added for DB Mode indicator & 'various' for Author. Wordpad added as optional file reader. SHIFT held down allows field to be cleared.

(v1.9) Added a Before and After program run for Calibre, with optional wait.

(v1.8) Prompt added for after Calibre command-line use, to open Calibre. You can now SCAN (and ADD) new ebooks, while the program is running, via a prompt to close the previous instance of the program.

(v1.7) Bugfix for Icon issue with Win 7 and up (user can manually edit INI).

(v1.6) Bugfix for last entry selection. Added an UP/DOWN arrow button, etc.

(v1.5) Added an Open My Kindle Content folder button. Some other buttons resized and changed to accomodate, with Run Calibre now a single button with a checkbox to use the Add List. Program Information updated.

(v1.4) Getting an Entry value is now taken from Input, rather than List. Info button added to top right of Book Display window. Exit button given an icon. An improvement added to FIX button for Author name punctuation etc. Name change in Registry context menu entry, to 'Use Scan Ebook'. Association warning check modified. Bugfixes, etc.

(v1.3) Calibre option buttons added, plus slight visual change (width increase etc) and minor adjustment to resizing.

(v1.2) Many improvements & features added, especially to scanning and both the results and database windows. Window can now resize to match a small (Netbook) size screen.

(v1.1) Sorting & Updating implemented. Buttons and more input fields added, and program information made available, plus view ebook in Notepad. More removals added and Titlecase improvements. Bugfixes, etc.
NOTE - With LOAD deselected, the list will only show the added ebook title (if any).

 TheSaint - June 2014 (last updated March 2019)
( http://www.autoitscript.com/autoit3/ ).


DROPBOX UPDATES
---------------
AZWDrop is a dropbox for my AZWPlug program, and runs as an independent executable, though it is run from it and interacts with it.  January 2018 - created by TheSaint

(v2.9) Improved the KFX support in various ways, making it optional with suitable warnings.

(v2.8) Added support for KFX files, which requires 7-Zip to be installed, and two Calibre plugins (KFX Input.zip, DeDRM_plugin.zip). A KFX-ZIP file is created (compiled from content) for selected ebook, to allow metadata to be read and is also used for any desired import to Calibre as a resulting KFX file.

(v2.7) Added an ability (with CTRL held down) to Jump to a specific number after current ebook is processed, so for YES now as well as NO. Holding SHIFT down when closing the AZWPlug program, stops the AZWDrop program parsing the next unlisted ebook entry. BUGFIX for meta info saved to Settings.ini for last ebook added to database (carriage returns are stripped or replaced).

(v2.6) Added a 'Start At' number Inputbox query element, for saving unlisted ebooks to a list file. It is now possible to see what ebook was last added, using the 'LAST ebook ADDED to Database' right-click option. The 'PASTE from clipboard' option has been relocated, to the first right-click option.

(v2.5) Added a right-click option to 'OPEN the SAVED List file location'. 'About' and 'EXIT' right-click options swapped position. Added a right-click option to 'RUN the UpdateFromOPF program'.

(v2.4) BUGFIX for 'ebook-meta.exe' option not switching off (oops). Added some new right-click options to the drop zone ... EXIT, RUN the CALIBRE program, SAVE a List of the UNLISTED to file. That last option is particularly helpful (for me anyway).

(v2.3) Added a CTRL with the NO option, to skip to a specified number for unlisted ebooks. Coupled with that, if AZWPlug has an entry for an existing calibre executable, then the 'ebook-meta.exe' found in the same folder, can be used to get Title and Author, and display that to help with deciding when to add an ebook. Enable the dropbox right-click 'Use calibre to GET the TITLE' option, to use that feature. Added support for AZWPlug v4.0, and the new Method 0.

(v2.2) Added a 'RUN the AZWPlug program' right-click menu option. The Query for skipping files can now be set to bypass while the program is running.

(v2.1) Added a 'Count of ebook files' right-click menu option, that also reports total size of 'Kindle Content' folder. Changed the way ebook files are skipped, so they are no longer part of the total count of unlisted ebooks.

(v2.0) Added an 'About' right-click menu option with above description. Also a 'Skip' option for ebooks you might always skip, never intending to ADD to the database or send to calibre from AZWPlug. Reset option to restore those skipped ebooks also added.
