15 May

Using Automator to convert Pages to PDF

Recently we were asked how to use Automator to convert Apple Pages documents into PDFs. In the spirit of sharing the knowledge, here’s how we did it.

It’d be great to make an app which we could drop our Pages files on and have them made into PDFs. The obvious way to make such an app is with Automator. Unfortunately, Pages doesn’t ship with Automator actions (although there are some funky third party options)

Luckily, Pages is AppleScriptable so we can make our own action. Let’s look at how to do that.

First, launch Automator (you’ll find it in your Mac’s Applications folder). Select “Application”.

Screen Shot 2016-05-12 at 13.19.38

Next, drag a “Run AppleScript” workflow into your workflow so you have something that looks like this:

Screen Shot 2016-05-12 at 13.20.06

Replace all the purple text in the action with the following AppleScript:

on run {input, parameters}

repeat with theFile in input
tell application "Finder"
set theFilesFolder to (folder of theFile) as text
end tell

tell application "Pages"
set theDoc to open theFile

set theDocName to name of theDoc
set theName to (characters 1 thru -7 of theDocName) as text
export theDoc as PDF to file ((theFilesFolder & theName & ".pdf") as text)

close theDoc

end tell
end repeat
return input
end run

Save the workflow and you should now have an app that you can drop Pages documents on.

Note that it’s up to you to make sure that the documents you drop actually are Pages documents – the script doesn’t check and may error if you drop the wrong type of documents.

On a related note, if you’d rather dodge the AppleScripting all together then you could try out our handy Pages Automator Actions.

While we have your attention… why not check out our macOS apps?

Barcode Basics – macOS barcode generator (including Automator support)
Ai Actions – Automator action pack for Adobe Illustrator
Pages Automator Actions – Automator action pack for Pages

09 May

Backing up a folder on macOS with rsync

Terminal

Quite often we’re asked how to keep a backup folder in sync with a work in progress folder. There are many possible solutions apps and third party solutions out there, but its quite easy to set up a rough, homespun backup solution. All you need is a little command line wizardry using something called rsync.

Syncing with rsync

First, lets imagine we have two folders on our desktop. One is called WIP, which contains all my work in progress. The other is called Backup which is where I’d like to keep a backup of all my WIP.

Open up a Terminal window (you’ll find Terminal in /Applications/Utilities) and type:

rsync -av --delete

Don’t hit return yet! Next, drag the WIP folder onto your Terminal to get the path to your folder. Add a slash to the end of it. You should have something like this:

rsync -av --delete /Users/YourUserName/Desktop/WIP/

Don’t hit return yet! Of course, the path will be different on your Mac – don’t worry about it. Next, drag the Backup folder onto the Terminal. You should now have something like this:

rsync -av --delete /Users/YourUserName/Desktop/WIP/ /Users/YourUserName/Desktop/Backup

Now you can hit return! You should find that the contents of WIP are copied to Backup. If you run the command a second time, nothing will happen. This is the beauty of rsync. It’s smart enough to only copy files from WIP if an identical copy doesn’t already exist in Backup. Our “–delete” option means that anything in in Backup that’s NOT in WIP gets deleted.

Of course, your backup folder can be anywhere – on an external drive or even on a remote server.

Scheduling

There are a number of ways to make this rsync command run a schedule. You could run it via a scheduled Automator action, via cron using something like Cronnix, or (my favourite) using a Launch Agent.

Have fun with your new backup command!

While we have your attention… why not check out our macOS apps?

Barcode Basics – macOS barcode generator (including Automator support)
Ai Actions – Automator action pack for Adobe Illustrator
Pages Automator Actions – Automator action pack for Pages

09 May

How to split PDF into PNG files in OS X

One pdf to multiple png files

We were asked recently how to split a PDF file into PNG files on Mac OS X. That’s to say, if the PDF has five pages then you’d want five PNG files produced, one for each page. Here are some options:

Adobe Acrobat
If you have Adobe Acrobat (not to be confused with the free Acrobat Reader) then you an simply open the PDF and select File>Save As and select “PNG”. However, Acrobat is expensive for what it is and there are some free alternatives such as…

PROs: Very easy to do
CONs: Acrobat Pro is expensive and probably not worth the price if this is all you’ll ever use it for.

Third party website
Probably the easiest way is to use a web site such as pdf2png.com. Whilst I’m sure they’re a reputable site and we’ve used them successfully in the past, its always worth thinking twice before uploading anything that may be confidential to a third party site.

PROs: Also very easy
CONs: Can be slow if you need to upload a big pdf. Think about security.

ImageMagick
If you’re comfortable on the command line then you can use ImageMagick to do the heavy lifting. If you don’t have it installed already then we recommend using the installer from Cactus Labs.

Once you have ImageMagick installed, you can fire up the Terminal and use a command like:

convert ~/Desktop/myfile.pdf ~/Desktop/myfile.png

…and ImageMagick should do the rest, including sequentially naming the files. Don’t forget to change the paths to the documents to your own!

PROs: Completely free. Also ImageMagick has lots of other uses if you work with graphics. It’s worth having in your arsenal! For extra credit, you can even get ImageMagick working through Apple’s Automator to build your own custom workflow.
CONs: You need to be reasonably comfortable with using the Terminal.

There are plenty of other ways, but these are the ones that work best in our experience. Let us know if you’ve found any better ways!

While we have your attention… why not check out our macOS apps?

Barcode Basics – macOS barcode generator (including Automator support)
Ai Actions – Automator action pack for Adobe Illustrator
Pages Automator Actions – Automator action pack for Pages

03 May

Automating HTML to PDF conversion on OS X

Ever wondered how to convert a big batch of html files into PDFs?

Well, you *could* open each html file in the web browser of your choice and save/print it as a PDF. However, that’s going to take a long time for a big batch. One fun way you can do it in macOS is by creating an Automator service to do the donkey work for you. Let’s take a look at how to do that.

First, launch Automator (you’ll find it in your Mac’s Applications folder) and create a Service document (NB. Click any of the screen shots here to enlarge them).

Create Automator Service

Next, set the services input options as shown below.

Screen Shot 2016-05-03 at 14.09.55

Next drag in a Run Shell Script action. Make sure you set it’s “Pass input” option to “as arguments” – that’s important! This lets us pass the files we select as an input to the shell script.

Screen Shot 2016-05-03 at 14.10.33

Change it’s contents to:

for theFileToProcess in "$@"
do
cupsfilter "$theFileToProcess" > "${theFileToProcess%.*}.pdf"
done

And save it as “HTML 2 PDF”, or whatever makes sense to you. Now it should look like this:

Run Shell Script options

Now, if you select a one (or more!) HTML files in in Finder whilst holding your control key down, you should be able to find the service you just created under “Services”. as shown below. Select it and you’ll run the shell script on all the files you selected!

Screen Shot 2016-05-03 at 14.13.29

Note that this will work best on fairly simple html – if you have heaps of JavaScript, movies etc in your html then the PDFs may not be great. However, its a handy quick way of taking some of the pain out of converting html to pdf.

While we have your attention… why not check out our macOS apps?

Barcode Basics – macOS barcode generator (including Automator support)
Ai Actions – Automator action pack for Adobe Illustrator
Pages Automator Actions – Automator action pack for Pages

30 Jan

Are you an Adobe Illustrator drudge?

Automator actions for Adobe Illustrator

If you’re a regular user of Adobe Illustrator then you probably find yourself doing more than your fair share of drudge work. Here’s a way of avoiding some of it…

Drudge work comes in many forms, for example gathering all those linked images together ready to send your files for printing. Or opening a large number of files, saving each one as a PDF and uploading them to an FTP site. The sort of stuff you never really signed up for when you decided to become a graphic designer or artworker.

Of course, you could teach yourself AppleScript and write your own scripts to automate your workflow. But who’s got time to learn AppleScript? Or you could hire an AppleScript expert. Or you could invest in technologies like Automation Engine from ESKO, but the price tag puts those options beyond the budget of many freelancers and many small businesses.

This is where our product Ai Actions comes in. It adds support for Adobe Illustrator to Apple’s workflow software, Automator. If you can drag and drop then you can create your own automatic workflows to automate Illustrator and integrate with other apps too such as Mail, Preview etc. You can even save your workflows as apps.

A sample action fro Ai Actions
Click here to see how to use Ai Actions to create a simple workflow in Automator.

If you want to try your hand at automating Adobe Illustrator then why not download the demo version of Ai Actions from here:

Ai Actions DEMO

…the demo version contains a small selection of the actions available in the full version which contains over 20 useful actions and is available from the Mac App Store.

Mac_App_Store_Badge_US_UK

07 Nov

We’re launching Priority Support Subscriptions!

All users get free support for Ghostotter products. However, we understand that our software is business-critical for some users and they need a faster support response than other users.

If that sounds like you then you might want to consider purchasing a priority support subscription (PSS). A PSS enhances the support options for your product with the following benefits:

A faster response
We always try to respond to support requests as quickly as possible. However, some users need a super-fast response. With a PSS, we will respond to your support request within 1 working day. (Normal response time is within 3 days).

A dedicated support contact
You will have a dedicated member of the Ghostotter development team who will be your first point of contact should you need help. NB. Contact will be via email and in English.

Priority support
Support requests from users with a PSS will be dealt with ahead of other support requests.

Priority development requests
Development requests (e.g. new feature requests) from users with a PSS will be prioritised ahead of other development requests. Be aware that not all development requests will be accepted.

More Info

20 Oct

The case of the elusive “℮”

Recently, I needed to choose a font on macOS which would support Russian and also the character “℮”. You can often find the ℮ character next to the weight/volume on packaging e.g. 150ml . It indicates that the value is estimated.

How did I figure that out? Luckily, I remembered one of our lesser known apps called Fonty, which was designed for exactly this kind of situation. Here’s what I did…

Firstly, launch Fonty and uncheck every language except Russian. Hey presto, we now have a list of fonts that contain all the glyphs required for the Russian language.

That’s great, but not all of these will have a glyph for the “℮” character. We need to filter out the fonts that don’t support it. This is where Fonty’s custom character sets come in. We select Preferences and click “Add” to add a new character set adding just the “℮”. Right there at the bottom, see?

Having closed the preferences window, I can now see my new character imaginatively called “℮”. If I select it *and* Russian, I can now see a list of all fonts installed on my Mac which support Russian and the ℮ character.

Of course, I could have just added the ℮ to my Russian character set. The beauty of doing it the way shown above is that you can select the ℮ in combination with other character sets. So for example, if you wanted to find out which fonts support Czech and ℮ then you’d just need to select Czech instead of Russian.

In conclusion, Fonty lets you choose the right font to use for the characters you need to support. You can get your copy from the Mac App Store!

Mac Font Repertoire checker validate validator

31 Jul

Custom screenshots app on macOS

Recently, a macOS user asked for a recommendation for an app which would take a screen shot and save it in a folder, with a name based on the current time in a particular format – they didn’t like the macOS default naming.

Rather than recommend an app, we showed them how to make their own using Automator. Here’s how to do it:

First, open up Terminal (found in /Applications/Utilities) and type:

pwd

…then return. It should give you a path that looks something like:

/Users/YourUserName/

If you add “Desktop” to the end of that then you have the path to your desktop. So, it should be something like:

/Users/YourUserName/Desktop/

Don’t forget the slash on the end.

Right! That was the hard bit. Next, replace the XXX in my line below with your desktop path:

theDate=$(date "+%Y-%m-%d_%H-%M-%S"); theSaveFolder="XXX"; screencapture -i -o "$theSaveFolder/$theDate.png"

Next, fire up Automator (in your Applications folder). Make a document of type “Application”. Then all you need to drag a “run shell script” action from the side bar into the main panel and replace the default text with the line above.

You should now have something that looks like this (click for a larger view):

Save your work, and you now have a shiny new app which will take screen shots and name them with a timestamp whenever you click it. Of course, you can play around with the time stamp format if you like. There’s a guide to the UNIX date command (which is what we’re using) here https://ss64.com/bash/date.html

For more cool ideas with Automator, why not check out:


04 Apr

Automating barcodes on macOS using a service

Many years ago now, I was the office barcode expert – in as much as I was the only person with a copy of any barcode creation software. Colleagues would email me frequently with lists of barcodes they wanted me to create for them. Sometimes the numbers would be in a Word file, sometimes an email, sometimes a text file – you name it.

If only there was a way I could just highlight the text and make barcodes. Well, in those days, there wasn’t but luckily now we have Barcode Basics. In this tutorial I’m going to show you how use Barcode Basics to create a Service in Automator to create barcodes from selected text.

NB. You can click any of the screen shots to enlarge.

1. Launch Automator
Make sure you’ve launched Barcode Basics at least once – that’s what installs the action we’re about to use. Next, launch Automator. You’ll find it in your Applications folder.

2. Create a new service
Click the “Service” option to make a new service.

Services appear under the File menu of many apps in macOS, including Finder and allow you to add functionality from other applications.

In our example, we’ll be adding functionality from Barcode Basics to any app capable of understanding text. So, make sure you set the settings up as follows.

2. Configure your barcode settings
Drag the “Make Barcode” action from the Actions library (the list on the left hand side of your Automator window) into your workflow and configure as necessary.

3. Make a new email
Next, drag a “New Mail Message” action (from “Mail” in your actions library) into your workflow. You can configure as much or as little in the “New Mail Message” action as you like. I’ve configured the subject and body.

4. Save the service
Next, press cmd-S to save your service and give it an appropriate name

5. Give it a test!
If you open any kind of text file (e.g. a Word file, a TextEdit file) you should now be able to see your action under its File>Services menu. Simply select the barcode numbers (which must be one per line), then run your action by selecting it in the Services menu. You should get an email with the generated barcodes as attachments.

I hope this demonstrated just how easy it is to create a service to generate barcodes and add them to an email. Automation with Barcode Basics and Apple’s Automator software really couldn’t be easier. And, of course, you can use Barcode Basics as a stand alone barcode generator too if you prefer.

I sure wish I had this back in my days as office barcode expert! If you haven’t given Barcode Basics a try yet, check it out at the Mac App Store.


Link to Mac App Store to purchase Barcode Basics - Mac barcode software

03 Apr

Creating a simple Automator workflow to make barcodes

In this tutorial, we’re going to create a very simple Automator workflow to create barcodes from user input. In future tutorials we’ll look at more advanced methods, but for now, lets keep things simple. You’re going to need a relatively recent version of macOS and an installed copy of Barcode Basics (that you’ve launched at least once!) if you want to follow along with this.

NB. You can click on any of these screen shots to enlarge them.

1. Launch Automator
Automator comes free with macOS and can be found in your Mac’s Applications folder. Launch Automator and create a new workflow.

2. Get some user input
Drag an “Ask for Text” action into your workflow. If you have trouble finding it, type “ask” into the search field to narrow down the options. Note that’s what I’ve done in the pic below.

3. Drag in a “Make Barcode” action
Drag in a “Make Barcode” user action. Again, if you have trouble finding it, type “Make Barcode” into the search field. If you can’t find it, it may be because you haven’t launched Barcode Basics – the actions get installed when it’s first run (if this is the case, quit Automator, launch Barcode Basics then start again). Your workflow should now look something like this.

You can configure the barcode settings as required. Note that the settings (e.g. BWR) apply to all barcodes made with this workflow.

4. Move the resulting files
Initially your files will be created in your Documents folder, in a sub folder called “Barcode Basics”. You should move them out of there to their required location to avoid that folder slowly growing in size. The “Move Finder Items” action is a good choice for this.

5. Run the workflow!
Press the “Run” button in your Automator workflow to generate barcodes! Enter a new one on each line to generate multiple barcodes.

This is an extremely basic example of creating an Automator workflow using Barcode Basic’s Automator action. In coming tutorials, we’ll look at creating a an Automator app, service and some more complicated workflows.

Naturally, you can still use Barcode Basics as a stand alone app. However, I hope this demonstrates how easy it is to automate barcode production. If I’ve sparked your interest then head over to the Mac App Store to pick up your copy!


Link to Mac App Store to purchase Barcode Basics - Mac barcode software