Skip to content

Instantly share code, notes, and snippets.

@james2doyle
Created April 30, 2014 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james2doyle/d72167e5dc01fbac6bd8 to your computer and use it in GitHub Desktop.
Save james2doyle/d72167e5dc01fbac6bd8 to your computer and use it in GitHub Desktop.
browse for a file and read the contents into a dialog
-- only read files with MD extension
set myFile to (POSIX path of (choose file with prompt "Select a file to read:" of type {"MD"}))
-- pipe the content into cat and then apply the result to theContent
set theContent to (do shell script "cat " & myFile) of result
display dialog theContent
-- close the file
close access myFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment