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" 2>&1 | 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>