Skip to content

Instantly share code, notes, and snippets.

@nriley
Created September 29, 2015 09:42
Show Gist options
  • Save nriley/fb2abd6f06f5f2619fd6 to your computer and use it in GitHub Desktop.
Save nriley/fb2abd6f06f5f2619fd6 to your computer and use it in GitHub Desktop.
local _outlinePath, _htmlPath, _htmlFolder, _outlineName, _itemsToCommit
tell application "OmniOutliner Professional"
tell front document
save
set _outlineName to name
set _outlinePath to path
end tell
set _htmlPath to ((characters 1 thru ((count characters of _outlinePath) - 4) of _outlinePath) as string) & ".html"
set _htmlFolder to (_htmlPath as POSIX file)
tell application "Finder"
if exists _htmlFolder then
move _htmlFolder to trash
end if
end tell
export front document to _htmlPath as "-//W3C//DTD HTML 4.01 Transitional//EN"
end tell
set _itemsToCommit to _outlinePath's quoted form & " " & _htmlPath's quoted form
do shell script "cd " & _outlinePath's quoted form & "/..; git add -A " & _itemsToCommit & "; git commit -m " & _outlineName's quoted form & "\": Updated status.\" " & _itemsToCommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment