Chris Erwin

Discrete and Discreet

December 10, 2008

InDesign CS3 and the Missing Jostens Toolbar

Filed under: Apple,Computers,Scripting,Technology — Chris Erwin @ 4:32 pm

Are you having problems with the Jostens toolbar not showing up in InDesign CS3?  Were you led here by Google?  Are you not interested in my uninteresting story on how I solved this technological mystery?  Then just issue these commands and move along.

sudo chmod -R a+w "/Applications/Adobe InDesign CS3/Plug-Ins/Jostens"
sudo find /Users -name "InDesign SavedData" -print0 | xargs -0 rm

If you’re here for the story, read on!

At work the yearbook team is using InDesign CS3 on OS X 10.4 to create the yearbooks this year.  We upgraded them to CS3 over the summer and I didn’t anticipate any problems.  Turns out we did have a problem, and it was a big one.

The printing is done by Jostens, who provided a CD with an InDesign plugin and some support files that are used for their specific layout.  I installed the plugin and opened InDesign to make sure the toolbar showed up.  It did, but unfortunately I tested it as a user with more file permission rights than the students.  I know better, but I’m also lazy, so what can I say?

A few days later the teacher reported the toolbar was not showing up when InDesign was opened.  I checked and sure enough the toolbar was not present when running InDesign as one of my student-level accounts.  To me, this pointed to file permissions issues.

I started by giving all users read, write, and execute permissions for /Applications/Adobe InDesign CS3/Plug-Ins/Jostens/.  I logged back in under my student account but the toolbar was still not there.  After trying all sorts of other crazy permission changes everywhere I tried another student-level account of mine.  To my surprise, the toolbar appeared when I ran InDesign.  Hmm.

I pondered this for a while, envisioning myself at the critical plot twist of an episode of House, ACSA.  I didn’t have a team to bounce ideas off of and insult, nor did I have a cane or a three-day beard.  I sure had a mystery on my hands though.  What was the difference between these two accounts?  I logged in and out of each one a few times, running InDesign and pondering the results.  When I logged in as cerwin, the toolbar did not appear.  When I logged in as chrise, it did.  Every time.

housets
 
 

“…can’t be autoimmune…”

I thought about ordering a CT or treating for sarcoidosis, but then I realized I had four more patients (computers) in the room, all presenting the same symptoms.  I wrote off the first patient as dead (for now) and slid down a seat.  Starting over, I logged in as an administrator and made /Applications/Adobe InDesign CS3/Plug-Ins/Jostens 777.  Is it a good idea to give normal users write rights to an important folder?  No, but I was in a hurry and figured I could restore that folder any time a user mucked with it.

Logged in as chrise.  The expectation was that the toolbar would show up fine, which it did.  Logged out and in as cerwin.  The expectation this time was that it wouldn’t show up, for no good reason.  Much to my surprise, it did show up.  Hmm.  It’s not Lupus.  But it is a compound problem, combining the permissions on the plugin folder with something else.

I thought a bit more until I realized the problem.  InDesign is caching its toolbar layout in a file in my profile somewhere.  Since cerwin had logged in on computer 1 before the permissions were fixed, the toolbar failed to launch, and InDesign made its layout cache without including that toolbar.  chrise had logged in after the permissions were fixed and thus InDesign’s layout cache in that profile included the Jostens toolbar.

Simple enough.  A few quick rm -r commands and I was back on computer #1 with a clean slate.  I logged in as cerwin and lo and behold, there was the toolbar.  Ok, that’s simple enough, I can just go around and delete everyone’s profile out of /Users, right?  It’s not that easy, since the users might have saved some larger files locally to avoid taking up space on the server.

I poked around /Users a bit until I found the offending file.  I finally found it: “InDesign SavedData”  Nice extension, Adobe.  No matter, as it was time for some bash fu.

sudo find /Users -name “InDesign SavedData” -print0 | xargs -0 rm

This removed the InDesign SavedData file from everyone’s profile and restored their access to the Jostens toolbar.

June 30, 2006

Wide-Spread File Deployment With VBScript

Filed under: Computers,Programming,Scripting,Technology,Uncategorized,Windows — Chris Erwin @ 4:27 pm

Quite often at work we need to deploy one or more files to large numbers of computers. The long way to do it is to manually copy to each computer through the network one at a time. When an entire school needs to be done, it gets very tedious. Another option is to set up a drag-and-drop event in Altiris Deployment Console, our deployment solution, which can then be deployed to an entire school in one shot. However, it can be annoying to set up a new event for every file that needs to be moved, and there are certain files it just doesn’t like to move (.url files for example).

Either my ‘hacker’ side who wishes to come up with creative solutions to problems, or my lazy side, led me to throw together a quick and dirty vbscript to take care of this. It had to be simple yet flexible enough that no code needs to be edited to change what files are being copied. The most challenging part was that I didn’t know anything about vbscript.

The reason I picked vbscript is because it can be executed on any Windows XP machine, so the work can be done from anywhere on the student VLAN. No compiling needed, and it’s more powerful than a batch file.

The script asks for four pieces of input. The file or files being copied, the directory on the remote computers to put the file in (same place on every machine), an input file containing a list of computers, and a log file to write to, so that we can manually hit any computer it missed.

Taking the input and copying the file are both very basic operations which anybody can learn to do with vbscript after a little googling. At the heart of the script is the LineParser function, which takes input from the computer name list and passes computer names to the CopyFile function. At first the computer name list file was just a list of full computer names, one per line, which were passed directly to the CopyFile function from the file system object. However, our computers are named schoolnumber-roomnumber-computernumber (##-[###|####]-##), so some loops should easily work. I then added the LineParser function to allow the input file to have one of three things on each line: a full computer name, a school number, or a room number and the number of computers in that room. Each line will either be ##-###-## or ## or ### ##. LineParser determines which of these three patterns is present on a line and acts accordingly.

If the line contains a school number (only two characters on the whole line):
If Len(LineReader)=2 then
SchoolNumber=LineReader
then the SchoolNumber variable is changed to that new school number. Any subsequent lines containing a room and number of computers will use that school number to construct computer names, until another school number line is encountered.

If the third character is a ‘-’ then the line must be a computer name. It is passed directly to the CopyFile function:
ElseIf Mid(LineReader,3,1)="-" then
FNameS = "\\" & LineReader & "\c$\" & MoveToPath
CopyFile(FNameS)

You can see the UNC path being built up from the rest of the user input.

If these two criteria are not met, then the parser assumes the line contains a room number and number of computers. If not, then the user constructing the input file screwed up, and I didn’t put any error protection in there for that so oh well. A loop then begins, passing computer names to the CopyFile function that are constructed using the room number and the last school number specified:

Else
     Room = Split(LineReader," ")     RoomNumber = Room(0)
     NumComps = Room(1)
     for i = 1 to NumComps
          if i < 10 Then
               iFixed = "0" & i
          Else
               iFixed = i
          End If
          CompName = SchoolNumber & "-" & RoomNumber & "-" & iFixed
          FNameS = "\" & CompName & "c$\" & MoveToPath
          CopyFile(FNameS)
     Next
End If

The vbscript function Split splits an input line at the delimiter given (space in this case) and tosses them into an array (so you end up with an array of words). The loop then builds computer names and passes them on. Fun stuff.

All of this results in allowing a flexible pseudo-language to be used to specify computers. an input file may look like this:
82
126 32
128 32
LIB 20
25-101-01
35-105-03
133 25
80
LIB 20
These 8 lines would result in the file(s) being copied to 131 computers. Note that the school number 82 persists past the two explicitly listed computers, until the school number 80 is specified.

The entire script can be found here. I plan to rearrange the if statement so that full computer names are the Else, so that any computer name can be used, not just those that follow the ##-… pattern. There are some other functions I’d like to add, but right now it does everything we need.

I learned two things in the two hours I spent doing it. I learned vbscript, and I learned that I don’t like vbscript. It is very inconsistent. It is certainly more powerful than batch programming, but doesn’t match perl, python, or any of the like for scripting. Oh well, it was fun.

Powered by WordPress