Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/usr/bin/osascript
  2.  
  3. on readFile(unixPath)
  4. set foo to (open for access (POSIX file unixPath))
  5. set txt to (read foo for (get eof foo))
  6. close access foo
  7. return txt
  8. end readFile
  9.  
  10. on run argv
  11. set unixPath to item 1 of argv
  12. do shell script "sed 's/$/<br>/' '" & unixPath & "' > /tmp/tmp"
  13. set bodytext to readFile("/tmp/tmp")
  14. do shell script "rm -f /tmp/tmp"
  15.  
  16. tell application "Notes"
  17. tell account "iCloud"
  18. make new note at folder "Notes" with properties {name:unixPath, body:bodytext}
  19. end tell
  20. end tell
  21. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement