home *** CD-ROM | disk | FTP | other *** search
Wrap
INI File | 1993-07-16 | 19.3 KB | 1,498 lines
[ver] 4 [sty] [files] [charset] 82 ANSI (Windows, IBM CP 1252) [revisions] 0 [prn] Olivetti JP 350 [port] LPT1: [lang] 1 [desc] Install The American Heritage Dictionary to Tools menu 741632143 21 735410161 316 6 0 0 0 0 1 [fopts] 0 1 0 0 [lnopts] 2 Body Text 1 [docopts] 5 2 [GramStyle] [tag] Body Text 2 [fnt] Times New Roman 240 0 49152 [algn] 1 1 0 0 0 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 0 1 1 0 0 0 0 [nfmt] 280 1 2 . , $ Body Text 0 0 [tag] Body Single 3 [fnt] Times New Roman 240 0 49152 [algn] 1 1 0 0 0 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 0 1 1 0 0 0 0 [nfmt] 280 1 2 . , $ Body Single 0 0 [tag] Bullet 4 [fnt] Times New Roman 240 0 49152 [algn] 1 1 0 288 288 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 <*0> 360 1 1 0 0 0 0 [nfmt] 272 1 2 . , $ Bullet 0 0 [tag] Bullet 1 5 [fnt] Times New Roman 240 0 49152 [algn] 1 1 288 288 288 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 <*5> 0 1 1 0 0 0 0 [nfmt] 280 1 2 . , $ Bullet 1 0 0 [tag] Number List 6 [fnt] Times New Roman 240 0 49152 [algn] 1 1 360 360 360 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 <*:>. 360 1 1 0 0 0 0 [nfmt] 272 1 2 . , $ Number List 0 0 [tag] Subhead 7 [fnt] Times New Roman 240 0 49155 [algn] 1 1 0 0 0 [spc] 33 273 1 72 72 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 2 0 1 1 0 0 0 0 [nfmt] 272 1 2 . , $ Subhead 0 0 [tag] Title 8 [fnt] Arial 360 0 16385 [algn] 4 1 0 0 0 [spc] 33 446 1 144 72 1 100 [brk] 16 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 1 0 1 1 0 0 0 0 [nfmt] 272 1 2 . , $ Title 0 0 [tag] Header 9 [fnt] Times New Roman 240 0 49152 [algn] 1 1 0 0 0 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 0 1 1 0 0 0 0 [nfmt] 280 1 2 . , $ Header 0 0 [tag] Footer 11 [fnt] Times New Roman 240 0 49152 [algn] 1 1 0 0 0 [spc] 33 273 1 0 0 1 100 [brk] 4 [line] 8 0 1 0 1 1 1 10 10 1 [spec] 0 0 0 1 1 0 0 0 0 [nfmt] 280 1 2 . , $ Footer 0 0 [lay] Standard 513 [rght] 15840 12240 1 1440 1440 1 1440 1440 0 1 0 1 0 2 1 1440 10800 12 1 720 1 1440 1 2160 1 2880 1 3600 1 4320 1 5040 1 5760 1 6480 1 7200 1 7920 1 8640 [hrght] [lyfrm] 1 11200 0 0 12240 1440 0 1 3 1 0 0 0 0 0 0 0 0 1 [frmlay] 1440 12240 1 1440 72 1 792 1440 0 1 0 1 1 0 1 1440 10800 2 2 4680 3 9360 [txt] > [frght] [lyfrm] 1 13248 0 14400 12240 15840 0 1 3 1 0 0 0 0 0 0 0 0 2 [frmlay] 15840 12240 1 1440 792 1 14472 1440 0 1 0 1 1 0 1 1440 10800 2 2 4680 3 9360 [txt] > [elay] [l1] 0 [pg] 6 33 0 5 512 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 77 0 7 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 115 0 5 512 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 160 0 0 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 204 0 16 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 232 0 0 1025 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0 [edoc] <:#284,9360>Install American Heritage Dictionary to Tools menu at startup. <:#284,9360> <:#284,9360><+!>How to Install The American Heritage Dictionary for Ami Pro<-!> <:#284,9360> <:#568,9360>You must run this macro file in order to install The American Heritage Dictionary to your Ami Pro Tools menu. <:#284,9360> <:#284,9360>Choose Tools/Macros/Playback, then select this file, INSTALAH.SMM, as the macro file to play. <:#284,9360> <:#568,9360>This macro file, along with the companion macro file AHD.SMM, are located in The American Heritage Dictionary directory, which is normally C:\AHDW. <:#284,9360> <:#284,9360><+!>What This Macro Does<-!> <:#284,9360> <:#568,9360>This macro installs AHD.SMM as the macro to automatically run at program load (Tools/User Setup/Program load, or automacroload= in AMIPRO.INI). <:#284,9360> <:#568,9360>If you already have a macro set to run at program load, then AHD.SMM will be called from the current auto-load macro. <:#284,9360> <:#568,9360><+">Note:<-"> If you are using the Ami autorun (2.0) or _autorun (3.0) macro as your auto-load macro, you may instead wish to edit AUTORUN.CFG (2.0) or AMIAUTO.CFG to add AHD.SMM. <:#284,9360>If you do so, be sure to copy AHD.SMM to your Ami macros directory. <:#284,9360> <:#284,9360><+!>If the Macro Fails<-!> <:#284,9360> <:#568,9360>Be sure that this file, INSTALAH.SMM, and AHD.SMM are in The American Heritage Dictionary directory. <:#284,9360> <:#568,9360>Check Tools/User Setup/Program load to see if you already have a macro entered and checked. If not, enter the path and name of AHD.SMM. <:#284,9360> <:#284,9360>If there is already an autoload macro assigned, you can edit it and add a call to AHD.SMM. <:#284,9360> <:#852,9360>Below the first line that begins with "FUNCTION," add a line with, "CALL d:\path\AHD.SMM!AHD1()" replacing "d:\path" with the drive and directory where macro is installed. <:#284,9360><+!> <:#284,9360><+!>Versions Supported<-!> <:#284,9360> <:#852,9360>The macros for The American Heritage Dictionary support versions 2.0 and 3.0 of Ami Pro. If future versions of Ami Pro use compatible macro syntax, then these macros should work in those versions as well. <:p<* >> <:#284,9360><+!>FUNCTION AHDLoad(Cmd)<-!> <:#284,9360>DEFSTR Char; <:#284,9360> <:#568,9360>IF (Decide("Choose Yes to install The American Heritage Dictionary to the Ami Pro Tools menu or choose No to quit.") = 0) <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360> <:#284,9360>Ahd = "AHD.SMM" <:#284,9360> <:#284,9360>'Use path of INSTALAH macro to find AHD macro <:#284,9360>AHMac = GetRunningMacroFile$() <:#284,9360>I = LEN(AHMac) <:#284,9360>WHILE "\" != Assign(&Char, MID$(AHMac, I, 1)) <:#284,9360> I = I - 1 <:#284,9360>WEND <:#284,9360>AHMac = Left$(AHMac, I) <:#284,9360>AHMac = strcat$(AHMac, Ahd) <:#284,9360>AHMac = LCASE$(AHMac) <:#284,9360>'Make sure that the AHD macro exists in the specified path <:#284,9360>IF "" = FindFirst$(AHMac, 33) 'include read-only and archive flags <:#284,9360> CALL AHDErr("Can't find {AHMac}.") <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini") <:#284,9360>'If there isn't currently an auto load macro or it is disabled, assign ours as the auto load macro. <:#284,9360>'If there is already an auto load macro, call it from AHD.SMM. <:#284,9360>IF (AutoLoad = "") <:#284,9360> CALL NewLoad(AHMac) <:#284,9360>ELSEIF "0" = LEFT$(AutoLoad, 1) <:#284,9360> CALL NewLoad(AHMac) <:#284,9360>ELSEIF (UCASE$(Ahd) = UCASE$(RIGHT$(AutoLoad, LEN(Ahd)))) <:#284,9360> 'CALL AHDErr("{Ahd} is already the autoload macro") <:#284,9360> CALL NewLoad(AHMac) ' reinstall anyway, in case path is invalid or macro is old <:#284,9360> EXIT FUNCTION <:#284,9360>ELSE <:#284,9360> AutoLoad = MID$(AutoLoad, 3, LEN(AutoLoad) - 2) <:#284,9360> FuncName = "" 'Filename may be followed by name of function to run <:#284,9360> I = strchr(1, AutoLoad, "!") <:#284,9360> IF (I <;>1) <:#284,9360> FuncName = MID$(AutoLoad, I + 1, LEN(AutoLoad) - I + 1) <:#284,9360> J = strchr(1, FuncName, "(") <:#284,9360> IF (J <;> 0) ' trim parentheses from name <:#284,9360> FuncName = LEFT$(FuncName, J - 1) <:#284,9360> ENDIF <:#284,9360> AutoLoad = LEFT$(AutoLoad, I - 1) <:#284,9360> ENDIF <:#284,9360> CALL ModifyLoad(AHMac, AutoLoad, FuncName) <:#284,9360>ENDIF 'This is what AHD will look up if invoked right now <:#284,9360>ClipboardWrite("Dictionary", 0) <:#284,9360> <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> <:#284,9360> <:#284,9360><+!>FUNCTION AHDErr(string)<-!> <:#284,9360> Message(string) <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> <:#284,9360> <:#284,9360><+!>FUNCTION AHDMsg(string)<-!> <:#284,9360> Message(string) <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> <:#284,9360> <:#284,9360><+!>FUNCTION NewLoad(AHMac)<-!> <:#284,9360>'Install AHD.SMM as the new Autoload macro <:#284,9360> <:#284,9360>AHMac = strcat$("1," AHMac) <:#284,9360>WriteProfileString("AmiPro", "automacroload", AHMac, "amipro.ini") <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini") <:#284,9360>IF (AutoLoad <<<;> AHMac) <:#284,9360> AHDErr("Can't install auto-load macro {AHMac}.") <:#284,9360>ELSE <:#284,9360> Cmd = MID$(AHMac, 3, LEN(AHMac)) <:#284,9360> Cmd = strcat$(Cmd, "!AHD1") <:#284,9360> CALLI {Cmd}() <:#568,9360> AHDMsg("Auto-load macro is now {AHMac}. The American Heritage Dictionary has been added to the Tools menu.") <:#284,9360>ENDIF <:#284,9360> <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> <:p<* >> <:#284,9360><+!>FUNCTION ModifyLoad(AHMac, AutoLoad, FuncName)<-!> <:#284,9360>'Edit existing auto-load macro to invoke AHD macro from it <:#284,9360> <:#284,9360>'Find current AutoLoad macro <:#284,9360>'If no path specified for autoload macro, prepend the Ami macro path to filename <:#284,9360>IF strchr(1, AutoLoad, "\") << 0 <:#284,9360> MacDir = GetMacPath$() <:#284,9360> IF ("\" <<<;> RIGHT$(MacDir, 1)) <:#284,9360> MacDir = strcat$(MacDir, "\") <:#284,9360> ENDIF <:#284,9360> AutoLoad = strcat$(MacDir, AutoLoad) <:#284,9360>ENDIF <:#284,9360>IF FindFirst$(AutoLoad, 33) = "" <:#284,9360> AHDErr("Can't find {AutoLoad} auto-load macro to modify.") <:#284,9360> CALL AskLoad(AHMac) <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360> <:#284,9360>'Check whether AutoLoad macro is already open and close it if so (abandoning changes) <:#284,9360>IF (SelectWindow(AutoLoad)) <:#284,9360> FileChanged(1, 0) <:#284,9360> FileClose() <:#284,9360>ENDIF <:#284,9360> <:#284,9360>'Make sure it is read-write <:#284,9360>ReadOnly = DOSGetFileAttr(AutoLoad) & 1 <:#284,9360>IF ReadOnly <:#284,9360> IF DOSSetFileAttr(AutoLoad, 0) <:#284,9360> AHDErr("Can't change read-only attribute of {AutoLoad}.") <:#284,9360> CALL AskLoad(AHMac) <:#284,9360> EXIT FUNCTION <:#284,9360> ENDIF <:#284,9360>ENDIF <:#284,9360> <:#284,9360>'Open the file <:#284,9360>IF (FileOpen(AutoLoad, 1, "") <<<;> 1) <:#284,9360> AHDErr("Can't open {AutoLoad}.") <:#284,9360> CALL AskLoad(AHMac) <:#284,9360> DOSSetFileAttr(AutoLoad, ReadOnly) <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360> <:#284,9360>'. . . continued . . . <:#284,9360> <:#284,9360> <:#284,9360><**>'Macro command string = filename + '!' + macro name <:#284,9360>Cmd = strcat$(AHMac, "!AHD1") <:#284,9360> <:#284,9360>'Check whether AHD is already installed <:#284,9360>IF (Replace(0, 0, FindFromPage1, Cmd, "") = 1) <:#568,9360> AHDErr("The American Heritage Dictionary has already been installed in auto-load macro {AutoLoad}.") <:#284,9360> FileClose() <:#284,9360> DOSSetFileAttr(AutoLoad, ReadOnly) <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360> <:#284,9360>'Find end of main or specified function and insert call to AHD <:#284,9360>TYPE("<[>CTRLHome]") ' go to the beginning of the document <:#284,9360>WHILE(TRUE) ' create a loop <:#284,9360> IF (Replace(0, 0, 0, "FUNCTION", "") = 1) <:#284,9360> TYPE("<[>ESC]<[>CTRLLeft]") ' deselect the word <:#284,9360> 'Function must be at start of line, else assume this isn't a real function definition <:#284,9360> IF (GetTextBeforeCursor$() = "") <:#284,9360> IF (FuncName = "") 'If function name unspecified, use first one in file <:#284,9360> BREAK <:#284,9360> ELSE 'Else check for specified function name <:#284,9360> TYPE("<[>CTRLRight]") ' next word is function name ThisFunc = LEFT$(CurWord$(), strchr(1, CurWord$(), "(") - 1) IF (LCASE$(ThisFunc) = LCASE$(FuncName)) <:#284,9360> BREAK ' this is the auto-load function <:#284,9360> ENDIF <:#284,9360> ENDIF <:#284,9360> ENDIF <:#284,9360> TYPE("<[>End]") ' go to end of line then continue search to prevent endless loop <:#284,9360> ELSE <:#284,9360> AHDErr("Can't find {FuncName} macro function in {AutoLoad}.") <:#284,9360> FileClose() <:#284,9360> CALL AskLoad(AHMac) <:#284,9360> DOSSetFileAttr(AutoLoad, ReadOnly) <:#284,9360> EXIT FUNCTION <:#284,9360> ENDIF <:#284,9360>WEND <:#284,9360> <:#284,9360>TYPE("<[>End]<[>Enter]'Add The American Heritage Dictionary to the Tools menu.<[>Enter]") <:#284,9360>TYPE("CALL {Cmd}()<[>Enter]") <:#284,9360> <:#284,9360>'Try to save the file <:#284,9360>Messages(Off) <:#284,9360>IF (Save() != 1) <:#284,9360> FileChanged(1, 0) <:#284,9360> FileClose() <:#284,9360> DOSSetFileAttr(AutoLoad, ReadOnly) <:#284,9360> AHDErr("Can't save {AutoLoad}.") <:#284,9360> CALL AskLoad(AHMac) <:#284,9360> EXIT FUNCTION <:#284,9360>ENDIF <:#284,9360>Messages(On) <:#284,9360>'If saved successfully, put AHD on Tools menu now and inform user of successful completion <:#284,9360>CALLI {Cmd}() <:#284,9360>AHDMsg("The American Heritage Dictionary has been added to the Tools menu.") <:#284,9360>FileClose() <:#284,9360>DOSSetFileAttr(AutoLoad, ReadOnly) <:#284,9360> <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> <:#284,9360> <:#284,9360><+!>FUNCTION AskLoad(AHMac)<-!> <:#284,9360>'If we couldn't modify the old auto-load macro, ask the user whether to switch to our macro <:#284,9360> <:#284,9360>IF Decide("Choose Yes to install {AHMac} as the new auto-load macro or No to quit.") <:#284,9360> CALL NewLoad(AHMac) <:#284,9360>ELSE <:#284,9360> AHDErr("American Heritage Dictionary NOT installed to Tools menu.") <:#284,9360>ENDIF <:#284,9360> <:#284,9360><+!>END FUNCTION<-!> <:#284,9360> > [Embedded] 00015937 > [macsum] 6 AHDLoad 0 1 8 33 AHDErr 1206 1 1 87 AHDMsg 1240 1 1 92 NewLoad 1274 1 3 97 ModifyLoad 1710 3 5 115 AskLoad 3455 1 1 221 [macse] 14 AHDLoad 0 2 "Choose Yes to install The American Heritage Dictionary to the Ami Pro Tools menu or choose No to quit." 13 5 0 18 0 11 00000162 6 1 15 9 7 "AHD.SMM" 8 3 0 802 13 8 4 0 14 "{4}" 13 8 5 7 "\" 0 15 "{4}" "{5}" 1 13 0 805 &2 [X] 13 18 1 11 00000318 6 5 5 1 3 1 8 5 10 00000217 0 806 "{4}" "{5}" 13 8 4 0 16 "{4}" "{3}" 13 8 4 0 17 "{4}" 13 8 4 7 "" 0 280 "{4}" 33 13 18 0 11 00000480 16 AHDErr "Can't find {4}." 6 1 15 9 0 286 "AmiPro" "automacroload" "amipro.ini" 13 8 6 6 6 7 "" 18 0 11 00000595 16 NewLoad "{4}" 10 00001171 7 "0" 0 806 "{6}" 1 13 18 0 11 00000671 16 NewLoad "{4}" 10 00001171 0 18 "{3}" 13 0 14 "{3}" 13 0 807 "{6}" [X] 13 0 18 [X] 13 18 0 11 00000800 16 NewLoad "{4}" 6 1 15 9 10 00001171 0 14 "{6}" 13 5 2 3 1 0 15 "{6}" 3 [X] 13 8 6 7 "" 8 7 0 13 1 "{6}" "!" 13 8 5 6 5 5 1 18 3 11 00001138 6 5 5 1 3 0 0 14 "{6}" 13 6 5 3 1 5 1 3 0 0 15 "{6}" [X] [X] 13 8 7 0 13 1 "{7}" "(" 13 8 8 6 8 5 0 18 3 11 00001097 6 8 5 1 3 1 0 806 "{7}" [X] 13 8 7 6 5 5 1 3 1 0 806 "{6}" [X] 13 8 6 16 ModifyLoad "{4}" "{6}" "{7}" 0 1038 "Dictionary" 0 6 1 15 9 14 AHDErr 0 3 "{0}" 6 1 15 9 14 AHDMsg 0 3 "{0}" 6 1 15 9 14 NewLoad 0 16 "1," "{0}" 13 8 0 0 287 "AmiPro" "automacroload" "{0}" "amipro.ini" 0 286 "AmiPro" "automacroload" "amipro.ini" 13 8 2 6 2 6 0 18 1 11 00000233 16 AHDErr "Can't install auto-load macro {0}." 10 00000424 0 14 "{0}" 13 0 15 "{0}" 3 [X] 13 8 3 0 16 "{3}" "!AHD1" 13 8 3 16 "{3}" 16 AHDMsg "Auto-load macro is now {0}. The American Heritage Dictionary has been added to the Tools menu." 6 1 15 9 14 ModifyLoad 0 13 1 "{1}" "\" 13 5 0 18 5 11 00000174 0 295 13 8 4 7 "\" 0 807 "{4}" 1 13 18 1 11 00000147 0 16 "{4}" "\" 13 8 4 0 16 "{4}" "{1}" 13 8 1 0 280 "{1}" 33 13 7 "" 18 0 11 00000304 16 AHDErr "Can't find {1} auto-load macro to modify." 16 AskLoad "{0}" 6 3 15 9 0 796 "{1}" 13 11 00000353 0 34 1 0 2 147 1 0 775 "{1}" 13 5 1 25 1 8 5 6 5 11 00000520 0 776 "{1}" 0 13 11 00000520 16 AHDErr "Can't change read-only attribute of {1}." 16 AskLoad "{0}" 6 3 15 9 2 102 1 "{1}" 1 "" 13 5 1 18 1 11 00000646 16 AHDErr "Can't open {1}." 16 AskLoad "{0}" 0 776 "{1}" "{5}" 6 3 15 9 0 16 "{0}" "!AHD1" 13 8 6 2 488 1 0 0 8192 "{6}" "" 13 5 1 18 0 11 00000867 16 AHDErr "The American Heritage Dictionary has already been installed in auto-load macro {1}." 2 147 1 0 776 "{1}" "{5}" 6 3 15 9 0 6 "[16420]" 5 1 11 00001367 2 488 1 0 0 0 "FUNCTION" "" 13 5 1 18 0 11 00001245 0 6 "[27][16421]" 0 37 13 7 "" 18 0 11 00001220 6 2 7 "" 18 0 11 00001067 10 00001367 10 00001220 0 6 "[16423]" 0 23 13 0 23 13 0 13 1 [X] "(" 13 5 1 3 1 0 806 [X] [X] 13 8 7 0 17 "{7}" 13 0 17 "{2}" 13 18 0 11 00001220 10 00001367 0 6 "[35]" 10 00001354 16 AHDErr "Can't find {2} macro function in {1}." 2 147 1 16 AskLoad "{0}" 0 776 "{1}" "{5}" 6 3 15 9 10 00000882 0 6 "[35][13]'Add The American Heritage Dictionary to the Tools menu.[13]" 0 6 "CALL {6}()[13]" 0 30 0 2 103 1 13 5 1 18 1 11 00001607 0 34 1 0 2 147 1 0 776 "{1}" "{5}" 16 AHDErr "Can't save {1}." 16 AskLoad "{0}" 6 3 15 9 0 30 1 16 "{6}" 16 AHDMsg "The American Heritage Dictionary has been added to the Tools menu." 2 147 1 0 776 "{1}" "{5}" 6 3 15 9 14 AskLoad 0 2 "Choose Yes to install {0} as the new auto-load macro or No to quit." 13 11 00000135 16 NewLoad "{0}" 10 00000206 16 AHDErr "American Heritage Dictionary NOT installed to Tools menu." 6 1 15 9 00015962