Skip to content

Instantly share code, notes, and snippets.

@snown
Created March 27, 2012 21:33
Show Gist options
  • Save snown/2220524 to your computer and use it in GitHub Desktop.
Save snown/2220524 to your computer and use it in GitHub Desktop.
TextExpander AppleScript Snippet to produce Bacon Ipsum filler text
# Requires "JSON Helper" app. Available for free in the Mac App Store: http://itunes.apple.com/us/app/json-helper-for-applescript/id453114608?mt=12
set numberOfParagraphs to 2
tell application "JSON Helper"
set baconIpsum to fetch JSON from "http://baconipsum.com/api/?type=all-meat&start-with-lorem=1&paras=" & numberOfParagraphs
set resultString to ""
repeat with i from 1 to (count of items in baconIpsum)
set resultString to resultString & (item i of baconIpsum)
if i is not equal to (count of items in baconIpsum) then
set resultString to resultString & "
"
end if
end repeat
return resultString
end tell
@grahams
Copy link

grahams commented Mar 27, 2012

I pushed a python version of this script that doesn't have any external requirements, if you are interested:

https://github.com/grahams/textexpander

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment