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

14 Mar

Still the best AppleScript IDE

Script Debugger - AppleScript

Many moons ago, I was a humble (well, humble-ish) Graphic Designer at a small print shop. My life was made a misery by all the routine, time-consuming non-graphic design stuff I had to do in the course of the day. Stepping up business cards for output, exporting a stack of Illustrator files as PDFs, zipping and uploading files to FTP sites… it was a pain.

Sure, I’d heard of AppleScript and tried my hand at it but I just couldn’t make head nor tail of the scripting dictionaries. And when stuff wasn’t working I had no idea why not.

That all changed when I got my hands on a copy of Script Debugger from Late Night Software. I’ve been recommending it to would-be AppleScripters ever since. It gave a nice view of applications’ dictionaries and they suddenly made sense. It made debugging so much easier and I was actually able to figure out why my scripts weren’t working… most of the time anyway.

Over ten years on and I still use it on the (admittedly rare) occasions when I dip my toes into AppleScript, and I’d be lost without it. Script Debugger is still going strong and it looks like the latest release brings some cool new features and a stripped down free version.

If you have an interest in scripting/automation on macOS, do yourself a favour and get a copy of Script Debugger.

Of course, if you don’t want to get your hands dirty with scripting, you can talk to us about custom scripting. No job too small! Click here for more info.

NB. We’re not affiliated with Late Night Software in any way – we’re just big fans of their product.

24 Jul

Easy method of ad blocking on Mac OS X

no ads

Adverts are a common annoyance for most internet users. If you want to get rid of them then there are plenty of third party ad blockers around. However, if you want to get super-geeky then there’s a clever trick you can do using your Mac’s hosts file, and that’s what we’re going to look at today.

Apart from earning you many Geek Points, a hosts based approach has the advantage of not being bound to any one app (e.g. Safari) – it comes into play whenever any app accesses the internet.

About hosts files
Firstly, what is a hosts file? Put simply, a hosts file is a text file containing a look-up list of hostnames to IP addresses. For example, a web server’s IP address might be something unwieldy like “http://123.345.789.012”.

However, by editing your computers hosts file you can tell your computer that whenever you enter the address “http://myserver”, what you actually mean is “http://123.345.789.012”, and the computer will do the switcheroo for you automatically whenever you try to access that server.

So how does that help?
Adverts are usually hosted on servers other than the page you’re looking at. If we had an extensive list of known ad servers then we could use our hosts file to redirect links to those ad servers to something else. For example, that “something else” might be the ip address 127.0.0.0, which is almost certainly your Mac’s home address. Since we’re not running an ad hosting server from our Mac (hopefully!), those requests will fail and the ads would not load.

All we’re missing is a long list of known ad servers, right? Luckily, there is a list of them at someonewhocares.org which is regularly updated, and they also include many ‘dodgy’ sites including those with offensive content, known malware sources etc. So we have all the pieces of the jigsaw. Lets see how we can edit our hosts file to use this list.

  • Firstly, select Finder>Go To Folder, type “/etc/” in the box then click the “Go” button. (NB. without the quotes, but with the slashes!)
  • You should see a file called “hosts” in the folder you just opened. This is your hosts file. Make a backup copy of it and keep it somewhere safe, just in case.
  • Next, go to http://someonewhocares.org/hosts/ and copy the text from “# This hosts file brought to you…” down to the bottom (omitting the date that’s on the last line).
  • Open the hosts file in a text editor. I strongly recommend TextWrangler because word processors e.g. Word can add unseen mess into your file which can break things. If your Mac asks if you want to unlock the file, say “Yes”.
  • Paste your copied text into your hosts file and save it, making sure you save it as “hosts”, not “hosts.txt” or any other variant. NB. You may need your Mac’s admin password to save the file.
  • You’re done!

    If you experience any problems, or want to undo what we just did then just replace your edited hosts file with your backup copy. If you find a site that you want to visit is blocked, simply open the hosts file, find the line with the site in it and either delete that line or add a # before the line to disable it.

    If, after some time, you find you start seeing ads again then you may need to update the contents of your hosts file. Just go through the same procedure, but using the current list from someonewhocares.org – they update quite regularly.

    Happy (mostly) add free internet!

    09 Sep

    New way to get Ai Auto Save for Illustrator

    Hi,

    We’re trying out a new way for you to purchase your copy of Ai Auto Save (our Auto-save solution for Adobe Illustrator). You can now purchase Ai Auto Save through FastSpring’s secure purchasing site.

    Previously Ai Auto Save was available only through the Mac App Store. The Mac App Store is great because it means the app has been through Apple’s approval process so you can be confident it has nothing nasty in it. However, the Mac App Store can be fiddly for some users, especially if you’re buying on behalf of a business. FastSpring provides an alternative option which may be easier for some of you.

    Both methods of buying Ai Auto Save will be available. We’re interested to know what you think. Should we extend this to other Ghostotter products? Let us know via our Support page.

    Click either link below to purchase Ai Auto Save

    click_to_purchase

    Auto-save for Illustrator

    13 Jul

    Fonty price slashed!

    Fonty - the Font repertoire checker for Mac OS X

    We’ve reduced the price of our font repertoire checker, Fonty to $4.99*. Fonty allows you to check which of your installed fonts contains a particular character, or set of characters. Use the preset character sets or create your own.

    If you ever find yourself asking questions like, “Which of my fonts can I use for Russian and Greek?” or “Which of my fonts has the ® and £ symbols” then Fonty can help you.

    For more info, check out Fonty on the Mac app store:

    Mac Font Repertoire checker validate validator opentype truetype

    * or approx local currency equivalent

    16 Jun

    Free promo codes for Fonty

    Just a quick note to let you know that we just posted some free download codes for our font search app Fonty over at Macrumors here:

    http://forums.macrumors.com/threads/ann-fonty-plus-some-free-promo-codes.1892806/

    About Fonty…
    Fonty is an app to help you choose the a font (installed on your Mac) with the character support you need.

    For example, imagine you’re creating a document with text in English, Russian and Polish. It also needs to have the symbol for the Yen currency. You want to know which fonts you have which will support all the required characters. Fonty can tell you! Simply tick the characters sets and you’ll be shown all the appropriate fonts.

    Use the built in character sets or create your own

    Fonty ships with character sets for some popular languages and some symbols. However, you don’t have to search by language support. Fonty’s real strength is that you can create your own character sets (in File>Preferences) and use them to search your fonts. For example, you might want to search for fonts that support braille or musical symbols etc. No problem, just create a character set and you’re in business.

    App Store
    https://itunes.apple.com/app/fonty/id987510111

    12 Mar

    Mac App Store back online

    Hi,

    A number of users pointed out that yesterday (11th March 2015) they were unable to buy our products on the Mac App Store. This was because of an issue at Apple’s end and so was completely beyond our control. Luckily, the Mac App Store is now back online so if you were one of the unlucky few yesterday, please try again today. Apologies for the inconvenience.

    As a reminder, our products are:

    Barcode Basics – Barcode generation

    Ai Actions – Automator actions for controlling Adobe Illustrator

    OnScreen Barcode Scanner – Scans barcodes from your Mac’s screen

    Script Backgrounder – Make AppleScript Applets run in the background

    Stopwatch Basics – A simple stopwatch app

    PDF Basics – A simple PDF viewer with the ability to combine pdfs, extract pages and extract text.