// VEDITPDF.VDM - Open the VEDIT manual .PDF files using the associated // program, typically Adobe Acrobat. // // Originally by: Greenview Data, Inc. // Last change: 12/19/01 // // 2010-03-25 PL - Call Acrobat without using DOS shell // // Requires: VEDIT 6.00 or later. // // From VEDIT: Select {HELP, VEDIT manual}. // // Description: Open the VEDIT60.PDF or VPLUS60.PDF file by calling Acrobat or // by shelling out to the associated program. // // #104 = 0 // "0" - display help message // Can be patched by this macro if (#103==1) { Reg_Set(103,"vedit60.pdf") Reg_Set(105,"VEDIT 6.0 User's Manual") } else { Reg_Set(103,"vplus60.pdf") Reg_Set(105,"VEDIT 6.0 Macro Language Reference Manual") } if (!File_Exist("|(HOME)\|@(103)")) { if (#103==1) { Reg_Set(103,"vedit52.pdf") Reg_Set(105,"VEDIT 5.2 User's Manual") } else { Reg_Set(103,"vplus52.pdf") Reg_Set(105,"VEDIT PLUS 5.2 Macro Language Reference Manual") } if (File_Exist("|(HOME)\|@(103)")) { Reg_Set(105,"\n\nPlease note that this is an older version 5.2 manual which is\nnot completely up-to-date.",APPEND) } else { Alert() #120 = Dialog_Input_1(120,'`ERROR - Opening VEDIT manuals`, `Sorry, but it appears that the VEDIT manual ".PDF" files have not been installed on your computer. If desired, you can download them now from our Website. You will have to manually unzip the downloaded files into your VEDIT directory and then select this function again.`, `[&Cancel]`,`[Download]`',APP+CENTER,0,0) if (#120==0 || #120==1) { Return } Call("SETUP-HTTP") Sys(`|@(106) http://www.vedit.com/proddownload.htm#manuals`,#106) Return } } if (#104==0) { #120 = Dialog_Input_1(104,"`Open VEDIT manuals (test)`, `This will open the following VEDIT manual with Adobe Acrobat: |@(105) This function will only work if Adobe® Acrobat® or Adobe Reader is installed. If you do not have the Adobe Reader, it is available free of charge from the Adobe web site (www.adobe.com).`, `[]Don't show this message again`, `[&Open]`,`[&Cancel]`",APP+CENTER,0,0) if (#120==0 || #120==2) { Return } if (#104) { Call("PATCH") } } if (Is_WinNT) { //If WinNT/2000... #51=Reg_Free if (Registry_Get_Item(#51,"HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe\(Default)") > 0) { Reg_Set(#51,' "',APPEND) Reg_Set(#51,HOME,APPEND) Reg_Set(#51,"\",APPEND) Reg_Set(#51,@103,APPEND) Reg_Set(#51,'"',APPEND) System(@(#51),NOWAIT) Statline_Message(@(#51)) // debug } else { System(`"|(HOME)\|@(103)"`,DOS+SIMPLE+NOWAIT) Statline_Message("Using associated app") // debug } Reg_Empty(#51) } else { System(`start "|(HOME)\|@(103)"`,DOS+SIMPLE+NOWAIT) Statline_Message("Opening PDF file") // debug } Return // // SETUP-HTTP - Set @106 with best shell command to run the current // web-browser. Set #106 with any needed Sys() options. // :SETUP-HTTP: Registry_Get_Item(106,"HKEY_CLASSES_ROOT\http\shell\open\command\") if (Reg_Size(106)<5) { Reg_Set(106,"start ") #106 = 0 //No options for Win95/98/ME if (Is_WinNT) { //In WinNT/2000... #106 = DOS+SUPPRESS+SIMPLE //"start" only works from cmd box } return } // // Strip any command options specified in the registry. Needed for Opera. // #106=Buf_Num Buf_Switch(NAB) Buf_Empty(OK) Reg_Ins(106) Replace("/|M|>","",BEGIN+NOERR) BOF Reg_Copy(106,1) Buf_Quit(OK) Buf_Switch(#106) #106 = 0 //No Sys() options needed return // // PATCH - Save "[ ] Don't display again" option into this macro. // :PATCH: #108 = Buf_Num #107 = Buf_Free(EXTRA) Buf_Switch(#107,EXTRA) //Open veditpdf.vdm in an extra buffer // // Try to find the source file of this running macro. // if (File_Exist("veditpdf.vdm")) { File_Open("veditpdf.vdm",FORCE+OVERWRITE) } else { if (File_Exist("|(USERMACRO)/veditpdf.vdm")) { File_Open("|(USERMACRO)/veditpdf.vdm",FORCE+OVERWRITE) } else { if (File_Exist("|(MACRO)/veditpdf.vdm")) { File_Open("|(MACRO)/veditpdf.vdm",FORCE+OVERWRITE) } else { Goto PATCHDONE }}} // // Replace old "#104 =" value with new one. // if (Search("|<#104 = |D",BEGIN+ADVANCE+NOERR)) { Del_Char(-1) Num_Ins(#104,LEFT+NOCR) File_Save(NOMSG) //Save new value into source macro } :PATCHDONE: Buf_Quit(OK) //Close the temp buffer Buf_Switch(#108) //Switch back to original buffer return