Creating PNG-Images from Fonts Using Automator

In this first part of the tutorial I am going to show you how to convert your scale- and chord diagrams from text to png-images using the application Automator that comes with macos. Create images from Chords & Scales neck diagrams you wrote in Apple Pages or TextEdit – or even from Spotlight without opening any application. Part 2 and 3 of this tutorial will cover how to share these images on Facebook, add them to your website, attach them to emails or use them as stamps in forScore.

Watch the movie to get the idea.


 

Creating the Automator workflow

 

New Automator Document

 

  • open the application Automator that comes with macos
  • open a new document with Cmd-N
  • in the template window choose Workflow
  • as a start save the new document on the desktop as Chords Nut to PNG.workflow

 

Adding Actions To The Workflow

 

Action 1 · Run Applescript

Replace code

(* Your script goes here *)

with

tell me to activate

So the code looks like this:

on run {input, parameters}
	
	tell me to activate
	
	return input
end run

Press the Compile button.

Action 2 · Ask for Text
  • Question: Type chord name_fret position_string set
  • Default answer: e.g. Cmaj7_III_12345 or any other chord name (accordingly: e.g. Cmaj_scale_V for scale diagrams)
  • ☑ Require an answer
Action 3 · Set Value of Variable
  • double-click the action Set Value of Variable
  • Variable: select New Variable and hit Return
  • name it chord name (accordingly: scale name for scale diagrams)
Action 4 · Run Applescript

This Applescript adds a space right after your diagram in the clipboard

Replace code

(* Your script goes here *)

with

set diagram to (the clipboard) & " "
set the clipboard to diagram

So the code looks like this:

on run {input, parameters}
	
set diagram to (the clipboard) & " "
set the clipboard to diagram
	
	return input
end run

Press the Compile button.

☑ Ignore this action’s input

Action 5 · Get Contents of Clipboard
  • double-click the action Get Contents of Clipboard
Action 6 · Create Banner Image from Text
  • Untick Use text input as image filename
  • Save as: drag the variable chord name from the variable list at the foot of the right-hand pane to this field
  • Where: create the folder My Chords Images e.g. in your Documents folder (accordingly the folder My Scales Images for scale diagrams)
  • Text Style: custom
  • Typeface: Chords-Bold (Chords-Normal, Scales Normal, Scales Bold accordingly)
  • Size: 200
  • ☑ Replacing existing file
Action 7 · Scale Images
  • To Size (pixels): 800
Action 8 · Reveal Finder Items
  • double-click the action Reveal Finder Items
Action 9 · Display Notification (optional)
  • Title: Cool!
  • Subtitle: You created the image
  • Message: drag the variable chord name from the variable list at the foot of the right-hand pane to this field and add the suffix .png

 

Installing Workflows

  • create workflows for the fonts Chords Normal, Chords Nut, Scales Normal and Scales Nut
  • move the workflows from the desktop to ~/Library/Scripts/
  • open Script Editor located at /Applications/Utilities/
  • in Script Editor Preferences activate Show Script menu in menu bar
  • run the workflows from the menu bar as shown in the video

 

Activate Show Script menu in menu bar in Script Editor Preferences and create your own custom neck diagrams

 

Automator Workflow Overview

automator settings overview

Comments are closed.