Created
April 30, 2014 01:45
-
-
Save james2doyle/d72167e5dc01fbac6bd8 to your computer and use it in GitHub Desktop.
browse for a file and read the contents into a dialog
This file contains 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
-- 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