Discussion:
Command Line Create New BBEdit Document & Paste
Rich F
2014-12-15 18:05:13 UTC
Permalink
Hi folks.

I’d like to have BBEdit receive text that I have parked in a Ruby variable
coming out of open-uri. Is there a way to create a new document that’s
unsaved, then copy that variable to that document? I’m assuming I’ll use
the bbedit command line interface for this, but I can’t seem to find any
way of targeting a new document. Scratchpad might be an option, but it’s
not elegant.

Thanks for your input.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
John Delacour
2014-12-15 18:36:43 UTC
Permalink
I’d like to have BBEdit receive text that I have parked in a Ruby variable coming out of open-uri. Is there a way to create a new document that’s unsaved, then copy that variable to that document? I’m assuming I’ll use the bbedit command line interface for this, but I can’t seem to find any way of targeting a new document. Scratchpad might be an option, but it’s not elegant.
Smething like this?:

echo some_text > x.txt; open -a bbedit x.txt

JD
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Jeffrey Jones
2014-12-15 18:42:47 UTC
Permalink
Post by John Delacour
echo some_text > x.txt; open -a bbedit x.txt
It's easier than that.

echo some_text | bbedit --new-window

See the bbedit man page for other useful options.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
John Delacour
2014-12-15 22:07:26 UTC
Permalink
Post by Jeffrey Jones
Post by John Delacour
echo some_text > x.txt; open -a bbedit x.txt
It's easier than that.
echo some_text | bbedit --new-window
See the bbedit man page for other useful options.
OK if you want to wait all day for a dialog when you come to save the doc, which is what I experience all the time in Yosemite. I don’t know Ruby, but here’s an example with Perl:

perl -e '$_=49*108; print' > new.txt; bbedit new.txt

JD
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Alex Satrapa
2014-12-15 19:53:01 UTC
Permalink
The first method that comes to mind is to use a Unix pipe:

echo ‘foo’ | bbedit

Thus you would have your Ruby script output the text to be edited, then pipe that to bbedit:

ruby_script | bbedit

Perhaps I misunderstood the question?
Post by Rich F
Hi folks.
I’d like to have BBEdit receive text that I have parked in a Ruby variable coming out of open-uri. Is there a way to create a new document that’s unsaved, then copy that variable to that document? I’m assuming I’ll use the bbedit command line interface for this, but I can’t seem to find any way of targeting a new document. Scratchpad might be an option, but it’s not elegant.
Thanks for your input.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Rich F
2014-12-16 14:46:29 UTC
Permalink
That's excellent. You got it spot on. Works like a charm.

Thanks
Post by Alex Satrapa
echo ‘foo’ | bbedit
Thus you would have your Ruby script output the text to be edited, then
ruby_script | bbedit
Perhaps I misunderstood the question?
Hi folks.
I’d like to have BBEdit receive text that I have parked in a Ruby variable
coming out of open-uri. Is there a way to create a new document that’s
unsaved, then copy that variable to that document? I’m assuming I’ll use
the bbedit command line interface for this, but I can’t seem to find any
way of targeting a new document. Scratchpad might be an option, but it’s
not elegant.
Thanks for your input.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an
.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"***@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Loading...