; fm-start.ahk ; Set up FrameMaker for start with/out D+DD enhancements ; 2006-02-21 KLD ; 2006-02-22 Use script parameters => call needs to be ; AutoHotkey.exe [Switches] [Script Filename] [Script Parameters] ; AutoHotkey.exe fm-start.ahk 72en ; 2006-08-22 Add UI language selection, no parameters handled now ; 2007-08-17 added support for FM 8 - registry mod by *.reg files ; 2008-10-28 added UT-contents "Toolb/Fscript only" ; 2009-02-10 added FM-9 en ; 2009-12-15 added FM-9 de Menu, Tray, Icon, D:\System_ddd\icons\FM7-switch.ico Gui, Add, GroupBox, x015 y005 w330 h45, FrameMaker version Gui, Add, Radio, x020 y020 w120 h20 vver7, FM 7.2 Gui, Add, Radio, x160 y020 w120 h20 checked vver8, FM 8 Gui, Add, Radio, x280 y020 w120 h20 vver9, FM 9 Gui, Add, GroupBox, x015 y055 w150 h80, UI contents Gui, Add, Radio, x020 y070 w120 h20 checked vEnh, Enhanced Gui, Add, Radio, x020 y090 w120 h20 vOrig, Original Gui, Add, Radio, X020 y110 w120 h20 vFscript, FScript only Gui, Add, GroupBox, x195 y055 w150 h60, UI language Gui, Add, Radio, x200 y070 w120 h20 checked veng, english Gui, Add, Radio, x200 y090 w120 h20 vdeu, deutsch Gui, Add, Button, x045 y145 w090 h20 gDoIt, Start FM Gui, Add, Button, x230 y145 w090 h20 gNothing, Cancel Gui, Show, x800 y300 h180 w350, Start FrameMaker version/config Return GuiClose: Nothing: ExitApp DoIt: Gui, Submit ; powerDesk = 0 ; IfWinexist, PowerDesk ; { ; Winclose, PowerDesk ; this may hinder the deletions ; powerDesk = 1 ; } CheckLang: If eng { iF ver7 { ver = 72en ; in file names numver := "7.2" ; in %A_AppData% num2ver= 72 ; in registry, not used in this script } iF ver8 { ver = 8en numver := "8.0" num2ver = 80 } } iF ver9 { ver = 9en numver := "9" num2ver = 9 } If deu { iF ver7 { ver = 72de numver := "7.2" num2ver= 72 } iF ver8 { ver = 8de numver := "8.0" num2ver = 80 } iF ver9 { ver = 9de numver := "9" num2ver = 9 } } ; MsgBox, ver= %ver%`, numver =%numver%`, num2ver= %num2ver% SetUpFiles: If Orig { FileCopy, H:\Adobe\framemaker.%ver%\maker.ini.ori, H:\Adobe\framemaker.%ver%\maker.ini, 1 FileDelete, H:\Adobe\framemaker.%ver%\fminit\configui\CustomUI.cfg FileRemoveDir, H:\Adobe\framemaker.%ver%\fminit\Plugins, 1 FileCopyDir, H:\Adobe\framemaker.%ver%\fminit\Plugins.ori, H:\Adobe\framemaker.%ver%\fminit\Plugins If (num2ver <> 9) { ; no UI mods here FileCopy, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll.ori, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll, 1 } } If Enh { FileCopy, H:\Adobe\framemaker.%ver%\maker.ini.ddd, H:\Adobe\framemaker.%ver%\maker.ini, 1 FileRemoveDir, H:\Adobe\framemaker.%ver%\fminit\Plugins, 1 FileCopyDir, H:\Adobe\framemaker.%ver%\fminit\Plugins.ddd, H:\Adobe\framemaker.%ver%\fminit\Plugins FileCopy, H:\Adobe\framemaker.%ver%\fminit\configui\CustomUI.cfg.ddd, H:\Adobe\framemaker.%ver%\fminit\configui\CustomUI.cfg, 1 If (num2ver <> 9) { ; no UI mods here FileCopy, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll.ddd, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll, 1 } } If Fscript ; FrameScript only { FileCopy, H:\Adobe\framemaker.%ver%\maker.ini.fso, H:\Adobe\framemaker.%ver%\maker.ini, 1 FileDelete, H:\Adobe\framemaker.%ver%\fminit\configui\CustomUI.cfg FileRemoveDir, H:\Adobe\framemaker.%ver%\fminit\Plugins, 1 FileCopyDir, H:\Adobe\framemaker.%ver%\fminit\Plugins.ori, H:\Adobe\framemaker.%ver%\fminit\Plugins If (num2ver <> 9) { ; no UI mods here FileCopy, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll.ori, H:\Adobe\framemaker.%ver%\fminit\fmdlg.dll, 1 } } SetUpReg: ; Switching needs REG changes also: Run, regedit /s D:\System_ddd\registry\settings\fm%ver%.reg Sleep, 1000 ; give it some time ; check registry ; RegRead, whatsit, HKLM, SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FrameMaker.exe ; MsgBox, REG = %whatsit%`nshould be H:\Adobe\framemaker.%ver%\FrameMaker.exe ; ListVars ; ExitApp SetUpAppdata: ; clear the user-frame.ini file to get the global settings again dataDir = %A_AppData%\Adobe\FrameMaker\%numver%\ ; MsgBox, from = `n%dataDir%maker-min.ini`nto = `n%%dataDir%maker.ini FileDelete, %dataDir%maker.ini FileCopy, H:\Adobe\framemaker.%ver%\maker.ini, %dataDir%maker.ini if ErrorLevel MsgBox Could not copy maker.ini to %appdata%...maker.ini IfExist, %dataDir%maker.ini Run, H:\Adobe\framemaker.%ver%\FrameMaker.exe ExitApp