Hack 5 Manage Acrobat Plug-Ins with Profiles on Windows

figs/moderate.gif figs/hack5.gif

If you use Acrobat for several purposes, create several profiles.

If you use Acrobat for many different tasks, you probably need different plug-ins at different times. If you use third-party or custom plug-ins [Hack #97], it can become essential to distinguish the "production workflow" Acrobat from the "plug-in beta testing" Acrobat from the "on-screen reading" Acrobat. We can do that.

In the same directory as your plug_ins folder [Hack #4], create one folder for each profile, naming it like this: plug_ins.profile_name. For example, a production profile might have the folder name plug_ins.production. Copy the desired plug-ins into each profile folder; you can copy a plug-in into one or more folders. The plug_ins folder will be your default profile.

Copy the following code into a text file called C:\switchboard.bat. Edit its path to Acrobat.exe to suit your configuration. This batch file takes two arguments: the name of the desired profile and, optionally, a PDF filename. Following our previous example, launch Acrobat under the production profile by invoking C:\switchboard.bat production.

:: switchboard.bat, version 1.0

:: visit: http://www.pdfhacks.com/switchboard/


:: switch the Acrobat plug_ins directory according to the first argument;

:: the second argument can be a PDF filename to open; we assume that the

:: second argument has been quoted for us, if necessary


:: change into the directory with Acrobat.exe and plug_ins

@echo off

echo Acrobat Plug-In Switchboard Activated

echo  ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 

echo Do not close this command session;

echo it will close automatically after Acrobat is closed.

cd /D "c:\program files\adobe\acrobat 6.0\acrobat\"

if exist plug_ins.on_hold goto BUSY

if not exist "plug_ins.%1" goto NOSUCHNUMBER

:: make the switch

rename plug_ins plug_ins.on_hold

rename "plug_ins.%1" plug_ins

Acrobat.exe %2

:: switch back

rename plug_ins "plug_ins.%1"

rename plug_ins.on_hold plug_ins

goto DONE


@echo off

echo NOTE-

echo Acrobat is already running with a switched plug_ins directory.

Acrobat.exe %2

goto DONE


@echo off

echo ERROR-

echo The argument you passed to switchboard.bat does not match

echo a custom plug_ins directory, at least not where I am looking.

Acrobat.exe %2


Now, create a shortcut to switchboard.bat by right-clicking it and selecting Create Shortcut. Right-click the new shortcut, select Properties Shortcut, and add a profile name after the switchboard.bat target?e.g., C:\switchboard.bat production. Set the shortcut to run minimized. Change its icon to the Acrobat icon by selecting Change Icon . . . Browse . . . , opening Acrobat.exe, and double-clicking an icon. Click OK to close the Shortcut Properties dialog when you are done. Your result will look like Figure 1-6.

Figure 1-6. Creating a shortcut to switchboard.bat and passing in the name of a profile

Double-click your new shortcut to see that it works as expected. As you add profiles, copy this model shortcut and then edit its target to reflect the new profile's name. Copy these shortcuts to your desktop or your Start button for easy access.

If your production shortcut is named Acrobat Production and it is located in C:\, you can use it to open a PDF from the command line by running:

"C:\Acrobat Production.lnk" C:\mydoc.pdf

To integrate these profiles with the Windows File Explorer, see [Hack #6].