Original thread (Thank you fn101)
When editing/creating table maps, there are lots of tasks that are repetitive and time-consuming that can be automated. Here’s one of those tasks….
Once you have the tablemap laid out and need to create all the fonts you’ve already captured in replay frames, this tool will automate the process of “capturing” all of the font patterns for you to edit later.
What this script does: (From Folder‘s request)
1) Click Refresh (Next frame) (OS table view window)
2) Click Create Font (OS utilities window)
3) Either A) Click OK on “Font creation error” message box (no new fonts)
or B) Click OK on Font creation window (new fonts are found)
4) RepeatThis will cause all new fonts to be listed as “?” but those are easy to rename into the correct font or delete after wards.
When done (you have finished your coffee) you select a new text box, like the pot total, and start the script again.*
I think this would be a far less time consuming way to collect fonts/check your TM than doing this manually.
If anyone has created such a script I would like to hear from you, if anyone thinks this is a stupid thing to do, please let me know too.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | ; Since OpenReplay loops - "ESC" quits.. ; Required: OpenScrape loaded with a TM and connected to OpenReplay with a loaded frame. ; The number of replay frames to collect Local $ReplayFrames = 100 ; Change these depending on your PC's performance Local $QuickDelay = 250 ; How quickly to move to the next item. Give enough time for the Create Font button state to update. Local $RefreshDelay = 1000 ; How long before you start after refreshing the table. ; Leave the rest alone! Local $TitleTMPropWin = "[TITLE:TableMap;CLASS:#32770]" Local $TitleOpenScrape = "[CLASS:OpenScrape]" Local $TitleTreeView = "[CLASS:SysTreeView32; INSTANCE:1]" Local $TitleCreateFont = "[CLASS:Button; INSTANCE:24]" Local $TitleFontCreationError = "[TITLE:Font creation error;CLASS:#32770]" Local $TitleFontCreationOKButton = "[CLASS:Button; INSTANCE:1]" Local $TitleAddFontCharacters = "[TITLE:Add font characters;CLASS:#32770]" Local $TitleAddFontCharactersOKButton = "[CLASS:Button; INSTANCE:2]" HotKeySet("{esc}", "Quit") $TMPropWin = WinGetHandle($TitleTMPropWin) If ($TMPropWin=="") Then MsgBox(0, "FoldersFontTool", "OS TableMap Properties Window not found.") Exit EndIf ;Get handle to the treeview $TreeView = ControlGetHandle($TMPropWin, "", $TitleTreeView) fCW("$TreeView:" & $TreeView) ;Get the regions ControlTreeView($TMPropWin, "", $TreeView, "Expand", "#2", "") $Regions = ControlTreeView($TMPropWin, "", $TreeView, "GetItemCount", "#2") fCW("$Regions:"&$Regions) $CreateFont = ControlGetHandle($TMPropWin, "", $TitleCreateFont) If $Regions>0 Then For $xx = 1 to $ReplayFrames For $a = 0 to $Regions-1 $Select = "#2|#" & $a fCW($Select) ControlTreeView($TMPropWin, "", $TreeView, "Select", $Select, "") Sleep(100) If ControlCommand($TMPropWin, "", $CreateFont, "IsEnabled") Then While Not (WinExists($TitleFontCreationError) OR WinExists($TitleAddFontCharacters)) ControlClick($TMPropWin, "", $CreateFont) Sleep($QuickDelay) WEnd While WinExists($TitleFontCreationError) ControlClick($TitleFontCreationError, "", $TitleFontCreationOKButton) Sleep($QuickDelay) WEnd While WinExists($TitleAddFontCharacters) ControlClick($TitleAddFontCharacters, "", $TitleAddFontCharactersOKButton) Sleep($QuickDelay) WEnd EndIf Next SendKeepActive($TitleOpenScrape) Send("{F5}") Sleep($RefreshDelay) Next EndIf Func Quit() Exit EndFunc Func fCW($a) ConsoleWrite($a & @CRLF) EndFunc |