Created
March 27, 2012 21:33
-
-
Save snown/2220524 to your computer and use it in GitHub Desktop.
TextExpander AppleScript Snippet to produce Bacon Ipsum filler text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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¶s=" & 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I pushed a python version of this script that doesn't have any external requirements, if you are interested:
https://github.com/grahams/textexpander