A simple Javascript to copy a InDesign file

I need to become more proficient in Javascript. I took a request from a friend and created this.

Below is a link to a very basic script that will do the following: 

  1. Look at the current document
  2. Create a new folder on the desktop called ‘backup_ID_files’
  3. Create a new folder in the ‘backup_id_documents’ named with the name of the ID file, current date and timestamp.
  4. Place the ID file into the newly created directory. 

The end result can be seen below. 


The naming scheme allows the user to repeat the process since each ‘action’ creates a unique directory. 

Note that this is not a packaging mechanism. None of the linked files or fonts are brought together.


  1. Download the script below
  2. Place the script in the InDesign ‘Scripts Panel’ directory
  3. Go to ‘Window > Utilities > Scripts’. The script should appear in the palette.
  4. Open a InDesign document and double-click on the script
  5. The directory called ‘backup_ID_files’ will be created on the desktop and a folder containing your ID document will be inside.


Tested with CS6, CC on a Mac

Getting the script

Below is a link to the script. 



MacPorts and php53-apache2handler

Ok, this one slipped right by me. 

I was working on a project and added LDAP functionality to my PHP build and…. it the extension wasn’t loading! Blast!

Hmmm. After solving the problem I had I went back and did a little digging to figure out what the heck was going on. 

I checked Apache’s modules and noted that the libphp5.so file was from 2013. That told me that the php was not being compiled.

I discovered that I need to run this command in terminal, ‘php53-apache2handler’ after installing PHP 5.3. This then triggered the compile. 

It appears that the ‘php53’ port file doesn’t support the ‘+apache2’ command. Hence the need to run this command: 

sudo port install php53-apache2handler

In my case I had to remove this reference in the httpd.conf file: 

LoadModule php5_module modules/libphp5.so

and replace it with: 

LoadModule php5_module modules/mod_php53.so

Note that the command will also present you with the command to modify the httpd.conf file accordingly but will not remove the old reference. 

Guess I’m going to have to install from scratch at some point and document that. 



WoodWing elvis v4.5.1 released

We’ve released v4.5.1 of elvis and it has a couple of cool changes. 

Open with default application

New feature that lets a user open a file in the default application using a command key (command-O) or a contextual menu option.

Open with default application


Checking in files

Several changes here include UI changes and the addition of the ability to add a different file to check in. The idea is that you check out a .psd file and want to check in a png file. Naturally that’s just one idea but you get the concept.

Web Client

The web client has a new architecture AND now the ability to select items and use the Share functionality to share items with colleagues. 

Web Client Sharing



All in all another solid elvis release. The product manager and developers are continuing to work hard to make elvis the best DAM on the market.

If you haven’t worked with elvis before swing by the WoodWing web site and give it a try. You can get a 30 day trial here.

Mountain Lion and my MacPorts installations

I decided to take the Mac Mini I use for testing and upgrade to Mac OS X 10.8 and see if Enterprise would have any problems. The machine was previously on Mac OS X 10.6.8. So I did the old clone thing…just in case…and away I went.

Obviously this requires not only upgrading the machine but upgrading Xcode.

The result? So far so good. Everything works fine. This is a case where the result was exactly what I expected. I didn’t compile anything…just a straight upgrade.

The next step will be to remove all the parts and re-install them using MacPorts. It appears that, as of February, quite a few ports were broken (see here: Scotty-t.com). Note that the author also gives steps on how to fix the broken port issues so it should be an adventure.

The one thing that I really want to do is to have two distinct installations of Apache2/PHP. In this case it would be one for Enterprise 7 and one for Enterprise 8.

I’ll document what I’m up to and post away.

WordPress auto-update on a local machine (Mac OS X)

I’ve been using WordPress for years for my personal web sites (this one for example) but have never had a need to have a local instance.

I just installed WordPress on my personal machine for use with WoodWing Enterprise. Ran into a problem where I wanted to use the Auto-Update feature of WordPress but received the ‘dreaded’ FTP dialog.

I added this line to the bottom of my WordPress installation’s ‘wp-config.php’ file:

/** Sets up ‘direct’ method for wordpress auto update */
define(‘FS_METHOD’, ‘direct’);

Now auto update works.

Here is the reference page from the WordPress Codex.

I think the most important part to think about is:

(Primary Preference) “direct” forces it to use Direct File I/O requests from within PHP, this is fraught with opening up security issues on poorly configured hosts, This is chosen automatically when appropriate.

WoodWing Enterprise and CentOS 6.4

Spent some time bringing up a CentOS 6.4 VM that ran Enterprise and Elvis.

Had to install a few things on the Apache/PHP/MySQL front. Below are the commands that I ran to to get things running for Enterprise.

Keep in mind that your mileage will vary here as how you installed CentOS (For instance did you make the selection to install a ‘Web Server’ when running the installer) will make a big difference on what you have to do.

After you have created the VM (In my case I used Parallels because…that’s what I had).

CentOS 6.4

Install the base goodies.

yum -y install httpd php mysql mysql-server php-mysql

For PHP I had to install a few other extensions:

yum install php-mbstring

To get this installed I had to reference another repository and then run the command. Be sure to check the link below to make sure you are getting the correct version.

a. ‘rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

b. yum install php-mcrypt



Need to install php-pear and gcc (should already be installed)

yum install php-pear gcc

yum install ImageMagick



yum install php-xmlrpc

yum install php-soap

Install PHPMyAdmin

I installed PHPMyAdmin to work with MySQL. I like the tool. Easy to install and use.

Enterprise configuration changes

You’ll need to make one change to the server config files for the ‘locale’ setting.
a. Open ‘config.php’

b. Add setlocale(LC_ALL,”en_US.utf8″);’ after file encoding section at the bottom of the file.


WoodWing Community Site article about ‘locale’ setting

MySQL55 and MacPorts – problem when starting MySQL55

I’ve been fighting a problem with my installation of MySQL55. As you may know I have used MacPorts to install the whole stack that I use.

When trying to start MySQL55 I would get an error in Terminal with text like this:

Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed
syntax error near unexpected token `then’ mysql
Etc, Etc.

A bit frustrating.

I found this bug report on the MacPorts site 40040

So, to fix this I followed the first entry’s suggestion:

1. Navigate to this file: /opt/local/lib/mysql55/bin/mysqld_safe

2. Open the file in text editor and go to line 724. It will look like this:

then # The pid contains a mysqld process
The information after the ‘if’ statement is missing. It should look like this:

if “ps -ef | grep -v mysqld_safe | grep — $MYSQLD | grep $PID > /dev/null”
then # The pid contains a mysqld process
Now go back to Terminal and issue the command:

/opt/local/lib/mysql55/bin/mysqld_safe &
MySQL55 should now start.

MacPorts and Mac OS X 10.9

Update: Twitter user @neverpanic noted that if I had issued this command:

sudo xcodebuild –license
after the ‘sudo xcode-select –install’ command that would have fixed things up so that the ‘self update’ would not have failed.


I needed to make a change to MacPorts today and ran into a problem where MacPorts (when invoked from the Terminal) would throw the following error:

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed


The update to Mavericks blew out my Xcode command tools installation. (or it needed to be updated…)

You can either go to Xcode and install the tools or run this command:

sudo xcode-select –install
Now, in Terminal, try this command

sudo port selfupdate
In my case it failed…again.

I then went and started Xcode and started the application and the install seemed to finish.

I then ran the above command again to update MacPorts and this time it completed successfully.

MacPorts error “Mac Ports upgrade error Can’t map the URL”

Was upgrading one of my machines to the latest and greatest using MacPorts.

When I ran this command:

sudo port upgrade

I got this error:

Mac Ports upgrade error Can’t map the URL ‘file://.’ to a port description file (“Could not find Portfile in /”)

Odd. Hadn’t seen that one before.

A little digging around led to this solution. Run this command:

sudo port upgrade outdated

Problem solved!

WoodWing Enterprise and Solr – a dead simple install of Solr

Solr is a great tool when installed in conjunction with Enterprise. Lightning fast searching, facets…good stuff.

I’ve hand installed Solr and Tomcat for years. Every now and then however, SOMETHING happens that blows up the installation of Solr/Tomcat.

I finally got tired of fixing it and thought to myself “MacPorts has all the other stuff that I need. Why not Solr?”

Here’s how to install Solr using MacPorts

Install Solr

Start up Terminal
Update MacPorts by entering: sudo port self update
Install Solr: sudo port install apache-solr3
(this is version 3.6.2 of solr)
MacPorts will do its thing. Note that the ‘Jetty’ is being installed instead of Tomcat.

Install the new schema and server config files

Download the files you need from the Community site. This is the ‘Enterprise Solr Integration’ file containing the ‘schema.xml’ file and the ‘solrconfig.xml’ file.
Navigate to here:
Backup the existing ‘schema.xml’ file and the ‘solrconfig.xml’ files and then replace them with the ones you downloaded.
Start Solr

Start Terminal
Type in the command: sudo solr3
Solr should start. To see if it is working navigate to this URL:


Quitting Solr
In the Terminal window you started Solr in type ‘control-c’ where ‘control’ is the KEY on the keyboard and not the word.

Enterprise and Solr
Make sure to go into Enterprise’s ‘config_solr’ file and check the port that is entered at the top of the file. Make sure it matches the one that you are using with Solr.

If you have a pre-determined port you are using and the default doesn’t match the one you want to use then you’ll need to change the port that ‘Jetty’ is using.

Changing the Jetty Port

Navigate to this file:

Open the file in text editor

Search for ‘jetty.port’. This line should come up:

Name=”jetty.port” default=”8983″

Change the value of 8983 to the appropriate value

Save the file and restart Solr.