The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Redirecting command line output into OO Thread Tools Search this Thread Display Modes
I'm looking for a way to run a UNIX command and get the output of the command into a new default document in OO with a specified name.

did spend some time looking at the CSV export feature and wondered if there would be a way to from command line do the same with import, best would be to just do the following:

$ unix command | insert_into_oo -d';' DocumentName

And then get a document that contained the number of rows identified by the number of ';' in the input stream, all populated with data related to the specific row.
 
Seems like you ought to be able to do something like piping your command through tr to change the delimiter character to a newline and sending it into a file, then using osascript to tell OmniOutliner to open that file.

A rough example:
Code:
df | tr '\r' '\n' > /tmp/foobar.txt ; osascript -e 'tell application "OmniOutliner Professional" to open "tmp:foobar.txt"'
In this example, it isn't necessary to use tr, of course, but pretend that it was sticking a '\r' at the end of each line as the delimiter. You didn't actually say that you wanted the document opened on the spot, but that's how you would do it. Note that you have to use the old-style Mac file path syntax, not the Unix variety -- don't repeat my earlier mistake! This could all be bundled up into a shell script if you plan on doing such things frequently.
 
Thanks for the reply - did get another solution from one of colleague where I can direct the command straight into OmniOutline:

$ ls -l | perl -pe 's/\s+/\t/g; print "\n"' | open -f -a "OmniOutliner Professional.app"
 
Certainly fewer steps than my approach! I'll caution that my trial with that version just now took my filenames with spaces and split them into multiple columns, something to be aware of if you aren't expecting it...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Line Build Fails For OmniFileStore at OFSDocumentStore.m davidbitton Omni Frameworks 3 2012-06-12 11:03 PM
Exporting omnigraffle canvases to PDF,SVG,PNG,EPS from command line fikovnik OmniGraffle General 2 2011-06-13 05:28 AM
Export from the command line or AppleScript for specific contexts/projects? xuinkrbin. OmniFocus Extras 1 2010-09-30 03:21 PM
Selecting 003 rows with 'command-line' queries RobTrew OmniOutliner 3 for Mac 1 2010-07-08 01:46 AM
Create new search through command line m-rick OmniWeb General 1 2007-03-19 03:27 PM


All times are GMT -8. The time now is 02:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.