Wednesday, February 14, 2007

Another Web Development Position

I have another request for anyone interested in some web development work. Please get in touch with me if you are interested. Details follow...

I'm currently looking for a student (2nd year or higher) to take on some web
development work for us here in Corporate Marketing - 1 to 2 days a week
fitting in with their study schedule.

Here's a brief outline:

Essential skills
- HTML, CSS, graphics and JavaScript

Other desirable skills
- PHP, SQL/Databasing, Flash, design, audio and video

Software
- Dreamweaver, Fireworks, Flash

Thursday, February 08, 2007

Postscript Automator Actions

Having played with Automator some yesterday I thought it would be interesting to create an Automator action to perform the Postscript manipulation. This would mean that I could package the scripts together in a workflow to make producing the PDFs for my subjects even easier...

Creating an Automator action is actually quite easy. It basically uses an architecture inspired by Unix pipes. You can pass output from one action to the input of the next. I decided to create script actions as I already had the bash script all worked out. With this script the input is passed via the standard input. Automator also allows you to provide arguments via a simple user interface. These arguments are then passed in as environment variables. The following script illustrates the Postscript to PDF Automator action...



#!/usr/bin/env sh

if [ -e "$PS2PDFBIN" ]; then

while read line; do

if [ -e "$line" ]; then
FILETYPE=`/usr/bin/file -b -i "$line"`
if [ "$FILETYPE" = "application/postscript" ]; then

OUTDIR=`/usr/bin/dirname "$line"`
FBASE=`/usr/bin/basename "$line" .ps`
OUTNAME="${OUTDIR}/${FBASE}.pdf"

typeset -i I=1

while [ -e $OUTNAME ]
do
OUTNAME="${OUTDIR}/${FBASE}.$I.pdf"

I=$I+1
done

PATH=$PATH:`/usr/bin/dirname "$PS2PDFBIN"`
$PS2PDFBIN -q -sPAPERSIZE="$PAPER" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "$line" "$OUTNAME"

/bin/echo "$OUTNAME"
else
/bin/echo $line
fi

else
/bin/echo $line
fi
done
else

echo "Cannot locate executable: '$PS2PDFBIN'" 1>&2
exit 1
fi

I will upload the action bundles soon if anyone is interested...

Wednesday, February 07, 2007

Presentation to PDF

Today I have spent a significant time preparing my lecture notes for my subjects. The subject that I am preparing has a large number of PowerPoint files that need to be printed as PDF. I wanted to print all of the PowerPoint files to double sided PDFs. Rather than doing this manually I wanted to create a script to automate the process.

Opening the Files: the first part of my process involved creating a script to automate the process of opening the PDF files. I organise my documents in folders, so all of the documents that I wanted to print are located in a tree under a single directory.

The Automator workflow to open the PowerPoint files is actually very simple (shown here). I attached three finder actions. The first is the Get Folder Contents action. This action is used to process all of the items within the selected folder. Select the Repeat for each subfolder found, so that all of the subfolders are processed.

Following this action is the Filter Finder Items action. I use this action to filter the items to those that end with "Handout.ppt" as this is the ending to all of the presentations that I want to open. The last action in the workflow is the Open Finder items action. This action will open all of the items that are passed to it from the previous actions.

Printing the Presentations: The next step should have been simple... but it isn't. I started approaching this by creating a Applescript that printed via PDF. Getting the Print dialog to appear was simple, and examples all over the web illustrate how to click that PDF button, but none of them worked for me. I ended up using the UI element explorer and finding that the path to this menu is not easily achieved. In fact the explorer had issues highlighting it... If anyone knows how to get this working please let me know.

My next approach was to find a PDF printer... yes I know you can save as a PDF, but not with a script as far as I can tell. This was actually much easier than I first thought. Following the discussion on this forum. The best description is on the second page. Using this and some simple VBA script (basically for each presentation, print out the presentation) I can now print all of the open presnetations using the selected printer. Using the new PDF printer allows me to print these to PDF.

Next I wanted to have the PDFs printed two per page. Adjusting the print settings and printing via the script did not work. I started looking around and found some useful postscript editing utilities... So I had gone to all that effort to get the PDF printer and what I really wanted was a postscript printer. I created a modified version of the PDF script that copied the passed in postscript to a file, allowing me to use the existing scripts. Using this I was able to create postscript files of the notes for all of the presentation.

Scripting PS manipulation: To get the postscript modifying programs download Fink. This installer allows you to download common Unix utilities compiled to run on Mac OS X. Install the ghostscript, gv, and psutils-a4 package (for the A4 version). From the command line run the following instructions...

find . -type f -path "*.ps" -exec psnup -b0 -m0 -l -pa4 -2 {} "{}.ps"
find . -type f -path "*.ps.ps" -exec ps2pdfwr -sPAPERSIZE=a4 {}


This will create some strangely named file (a.ps becomes a.ps.ps and then a.ps.pdf), however the script will create the files as two per page PDF. The script also allows you to quickly process large numbers of presentations at once. With a little more work I am sure that I can create a better script, but this one has worked fine for the moment.

Monday, February 05, 2007

Interested in some part time PHP

With Uni about to go back, I have been asked if I know anyone who would be interested in a part time Job at Swinburne working on their web content using PHP... Are you interested?

Who are they looking for? A Swinburne student who is interested in programming, and in learning PHP and working with MySQL.
Do you need to already know PHP? No... as long as you are a capable programmer that should be fine.
How about MySQL? You need to know SQL...
How much time/money? One or two days a week in 2007 at $21 an hour
Who do I contact? Please contact me initially. I can then put you in touch with the person in question. You will need to have an interview...
When? You need to get in contact with me ASAP... before the start of semester 1.

Let me know if you are interested.

Thursday, February 01, 2007

More Mac Tools

After having watched a vast number of MacBreak issues over the last week I have started to play around with a number of new applications. I thought that I would share these with you...

The first piece of software that I have played with is Growl, a notification tool for the Mac. This allows me to display notification of various events, such as network address changes, track changes in iTunes, email, Adium etc. Growl also provides a nice network feature that allows me to get notifications from my notebook on my desktop. This allows me to work without having to look at the notebook screen for "interesting" events.

I have really enjoyed the Distracted Mac and related episodes with Merlin Mann and as a result have started playing around with the tools that he mentions in the episode. The first productivity enhancing change I have made is to clean up my desktop...

To really clean this I have been playing with Path Finder and its ability to hide the desktop icons. In addition to hiding the desktop icons this program provides a replacement for Finder. I am still using the trial and I am not sure that its worth the $, so I have been looking for alternatives. Path Finder is quite nice, but the interface is a little too busy. I'm not sure but I will think about it when my trial hsa run out.

Rather than switch to Path Finder on both my Macbook and my desktop I decided to look for another alternative. What I found was Desktop Sweeper, which is a Application Enhancer plug-in that hides desktop icons. This has worked really well, and I absolutely love the icon :)

The next tool is Menu Shades. This program provides the ability to hide the menu bar, removing another source of distraction. It is quite a nice program, but the problem is that it takes up space in the Dock. It would be much better is this had a menu bar icon... So I started looking for a way to remove the icon from the dock...

Having a look around I found the Dockless program. This provides an easy way to indicate to programs that you don't want them to load in the Dock. The program is a little "interesting" but it does work. The quit and relaunch buttons are used to quit or relaunch the selected applications... Anyway it all worked fine once I understood how it worked. Don't relaunch the Menu Shades program from this as it then fails to load it preferences. I got Dockless to remove it from the Dock and then manually restarted and it worked fine. Menu is shaded, and it is not in the Dock.

I have been playing around with some other applications, but more on those at another time. If you have some other interesting Mac applications let me know.