Mophilly -

I know you posted over a month ago, but I was just trying to sort out the 
same thing so I'll leave a note here of what I did in case you still need 
it or anyone else comes across this post. The solution is actually spread 
across a few of the comments in the post that was linked.

1. Download and uncompress the phptidy library as linked in that post. 
There also appears to be an updated but more Wordpress specific version 
here: https://github.com/scribu/wp-phptidy
2. Navigate to your BBEdit "Application Support" directory (either in 
~/Library or ~/Dropbox depending on your preference).
3. Copy the Tidy PHP.sh file to the "Text Filters" folder.
4. Copy the phptidy.php file to the "Unix Support" folder.
5. Open up the Tidy PHP.sh file in BBEdit and replace the content with the 
following code:

#!/bin/sh
cat /dev/stdin >orig
../Unix\ Support/phptidy.php source orig > output
if [[ -s output ]]; then
cat output;
else
cat orig;
fi
rm orig;
rm output;

 
5a. If you decided to grab the wp-phptidy you'll want to change line 3 
slightly
6. Now try to run the text filter within BBEdit from the Text>Apply Text 
Filter>Tidy PHP menu item.
7. Success! (hopefully)

There also may be a potential issue if you're running Mountain Lion - but 
I'm not 100% sure. I know that a lot of previously built in command line 
tools seemed to disappear in 10.8 but are re-installed with Xcode. Not sure 
if anything for these steps could be amongst the missing tools, but 
something to consider if you're troubleshooting.

On Sunday, August 19, 2012 10:49:34 AM UTC-7, Mophilly wrote:
>
> I have not tried to add a Text Filter to BBEdit before.
>
> I am having a bit of trouble getting this to work with BBEdit 10.1.2. I 
> followed the instructions at post referenced above, "Tidy and format your 
> PHP and meet WordPress standards on Coda and TextWrangler".
>
> First try I put the wp-phptidy.php file in /usr/bin/, and "Tidy PHP.sh" in 
> Text Filters. I got an error 32 trying to "apply text filter". Then I put 
> both files into the Text Filters directory. I got an error 32 trying to 
> "apply text filter" with Tidy PHP.sh or wp-phptidy.php.
>
> In both cases applied  chmod to the php file, and relaunched BBEdit before 
> attempting to invoke the script.
>
> Can someone point me to a "how to" or similar?
>

-- 
-- 
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>



Reply via email to