On Nov 25, 2016, at 16:48, Venmore <[email protected] <mailto:[email protected]>> wrote: > What is the best way to do this within BBEdit please?
> Can it be done on save/export whilst keeping original format for easy editing? Hey Carl, It looks like the yuicompressor java module is one of the more highly regarded compressors. (Of course you must have Java installed for it to work.) See the downloads area on this page: https://github.com/yui/yuicompressor/releases <https://github.com/yui/yuicompressor/releases> Using it in a BBEdit text filter is simple enough: ------------------------------------------------------------------------------------------- #!/usr/bin/env bash java -jar ~/Downloads/yuicompressor-2.4.8.jar --type css --charset utf8 ------------------------------------------------------------------------------------------- Give it a keyboard shortcut and go-to-town. ------------------------------------------------------------------------------------------- # An AppleScript version: ------------------------------------------------------------------------------------------- set bbeditText to bbeditFrontWinText() set shCMD to "java -jar ~/Downloads/yuicompressor-2.4.8.jar --type css --charset utf8 <<< " & quoted form of bbeditText set minifiedCSS to do shell script shCMD # Do whatever you want with the minifed css. ------------------------------------------------------------------------------------------- --ยป HANDLERS ------------------------------------------------------------------------------------------- on bbeditFrontWinText() tell application "BBEdit" tell front document to its text end tell end bbeditFrontWinText ------------------------------------------------------------------------------------------- * Note that you should pick a more permanent path for the yuicompressor module. -- Best Regards, Chris -- This is the BBEdit Talk public discussion group. 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> --- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
