4Misc_Start(#4Platform@9VersionCheck xHH@Rg(HHdh xHH@Rg(HHdh x HH@Rg(HHdh ^Graph*WDashSettings#  !4 4 4 4 4 4 homeTTdhd:Old Stuff:2021:2021-08-02:HistoryCarbonCopy Crash:CRecentWindowsUsing Igor.ihf 4Misc_End(#XOPState_Start(#SQL64XTest3-64XTestStructs64XTest7-64WaveRefTest-644XOPState_End(#\ •CreateHistoryCarbonCopy() !*// Platform=Macintosh, IGORVersion=9.000, architecture=Intel, systemTextEncoding="MacRoman", historyTextEncoding="UTF-8", procwinTextEncoding="UTF-8", recreationTextEncoding="UTF-8", build=37764 #pragma TextEncoding = "UTF-8" Silent 101 // use | as bitwise or -- not comment. DefaultFont "Helvetica" MoveWindow/P 132,48,1157,819 MoveWindow/C 4,785,1211,1022 KillStrings/Z root:gWMSetNextTextFilesTextEncoding #pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 // Use modern global access method and strict wave access #pragma DefaultTab={3,20,4} // Set default tab width in Igor Pro 9 and later // Function to creat a copy of the history area as a log Function CreateHistoryCarbonCopy() // kill the window if it exists DoWindow/K HistoryCarbonCopy NewNotebook /F=1/K=1 /N=HistoryCarbonCopy /W=(5,0,800,515)/OPTS=3 as "Command Log" Notebook HistoryCarbonCopy writeBOM=0 Notebook HistoryCarbonCopy backRGB=(0,0,0) // Set background to black Notebook HistoryCarbonCopy showRuler=0 // Define ruler to govern commands. // Igor will automatically apply this to commands sent to history carbon copy. Notebook HistoryCarbonCopy newRuler=Command, rulerDefaults={"Arial",10,0,(65535,65535,0)},margins={0,0,800} // Define ruler to govern results. // Igor will automatically apply this to results sent to history carbon copy. Notebook HistoryCarbonCopy newRuler=Result, rulerDefaults={"Arial",10,0,(0,65535,0)},margins={0,0,800} // Define ruler to govern user-generated error messages. // We will apply this ruler to error messages that we send to history carbon copy via Print commands. Notebook HistoryCarbonCopy newRuler=Error, rulerDefaults={"Arial",10,0,(65535,0,0)},margins={0,0,800} SetWindow HistoryCarbonCopy, hook(MyHook) = HistoryWindowHook // Install window hook End // hook to add the date and time to the start of each new line Function HistoryWindowHook(s) STRUCT WMWinHookStruct &s Variable hookResult = 0 switch(s.eventCode) case 8: // window modified NoteBook HistoryCarbonCopy selection={startOfPrevParagraph,startOfPrevParagraph},findText={"\r\n",2^0 + 2^4} Notebook HistoryCarbonCopy setData = Secs2Time(datetime,3,1)+"\t"+Secs2Date(datetime,3)+"\t" break endswitch return hookResult // 0 if nothing done, else 1 End