Skip to content

Instantly share code, notes, and snippets.

@tosbourn
Created September 26, 2016 14:58
Show Gist options
  • Save tosbourn/1a5f48c135c463c7738011109da33896 to your computer and use it in GitHub Desktop.
Save tosbourn/1a5f48c135c463c7738011109da33896 to your computer and use it in GitHub Desktop.
set names to read "/Users/IE14/Dropbox (InnovationEnterprise)/Email Marketing/Pesonalised Emails/NamesTest.txt" as «class utf8»
tell application "Adobe Photoshop CC 2015.5"
tell current document
# Access NAME layer
set current layer to layer "Name"
tell current layer to if not visible then set visible to true
# LOOP through names
repeat with name in (paragraphs of names as list)
# Add name to name layer
set contents of text object of current layer to name
# Save file as web ready thing
set theFilePath to path to desktop as text
set theOutput to theFilePath & "export-" & name & ".png"
set saveOptions to {class:PNG save options}
save it in file theOutput as PNG with options saveOptions appending no extension with copying
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment