Re: Reading Data from Text Window into a Shell Worksheet

2012-09-23 Thread Christopher Stone
Hey Doug,

On Sep 22, 2012, at 19:51, Doug McNutt dougl...@macnauchtan.com wrote:
 Have a look at shell tools pbcopy and pbpaste.  They can copy stdin into the 
 clipboard and copy the clipboard to stdout.
 
 date | pbcopy
 cat  somefile | pbcopy

I've used this sort of thing many times.

 pbpaste | tcsh

But I haven't used this one.

Good tip.  Thanks.

--
Take Care,
Chris

-- 
-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Reading Data from Text Window into a Shell Worksheet

2012-09-22 Thread Christopher Stone
Hey Folks,

Today I was prototyping some shell stuff for an Applescript, which I sometimes 
do in a BBEdit worksheet due to the extra quoting necessary in Applescript.  I 
like to get it working before I have to futz with the quoting.

Anyway.  Today I didn't feel like bothering to save my test data to a file and 
working from that, so I thought there has to be a better way...

I thought about using text from an unsaved window, and after a few minutes of 
wrestling to get the syntax right I came up with this:

WIN=untitled text 11
echo -e tell application \BBEdit\\nreturn text of text window \$WIN\\nend 
tell 21 | osascript \
| tr '\r' '\n' \
| awk '/src=.+\.jpg/ { print }' \
| sed -En '/a href=.+nyet/{
s/.+(http:.+\.jpg).+/\1/p
}'

I thought the general principle might be of use to someone, and I'm interested 
in better ways to accomplish this task if there are any.

--
Best Regards,
Chris

-- 
-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Reading Data from Text Window into a Shell Worksheet

2012-09-22 Thread Doug McNutt
At 04:54 -0500 9/22/12, Christopher Stone wrote:
Today I was prototyping some shell stuff for an Applescript, which I sometimes 
do in a BBEdit worksheet due to the extra quoting necessary in Applescript.  I 
like to get it working before I have to futz with the quoting.

Anyway.  Today I didn't feel like bothering to save my test data to a file and 
working from that, so I thought there has to be a better way...

I thought about using text from an unsaved window, and after a few minutes of 
wrestling to get the syntax right I came up with this:

WIN=untitled text 11
echo -e tell application \BBEdit\\nreturn text of text window \$WIN\\nend 
tell 21 | osascript \
| tr '\r' '\n' \
| awk '/src=.+\.jpg/ { print }' \
| sed -En '/a href=.+nyet/{
s/.+(http:.+\.jpg).+/\1/p
}'

I thought the general principle might be of use to someone, and I'm interested 
in better ways to accomplish this task if there are any.


Have a look at shell tools pbcopy and pbpaste.  They can copy stdin into the 
clipboard and copy the clipbnoard to stdout.

I miss them on my Linux box.

date | pbcopy
cat  somefile | pbcopy
pbpaste | tcsh

Are a particularly useful things to keep around in a bbedit worksheet.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit