On May 27, 2012, at 20:33, JT wrote:
> Hi, could someone tell me if there is a way to export the saved grep patterns
> in bbedit? Want to make sure I don't lose all my patterns in the event I have
> to do a fresh install.
______________________________________________________________________
Hey JT,
Having a fresh backup of BBEdit's app-support folder and its prefs is desirable
of course, but if you want a nice readable export give this Applescript a try.
------------------------------------------------------------------------------
set patternFile to "~/Library/Application Support/BBEdit/Setup/Grep
Patterns.xml"
set patternFile to do shell script "echo " & patternFile
tell application "System Events"
tell property list file patternFile's property list item
"SavedGrepPatterns"
set SavedGrepPatterns to value of property list items
end tell
end tell
set patternList to {}
repeat with i in SavedGrepPatterns
tell (contents of i)
set end of patternList to " Title: " & its Title
set end of patternList to " SearchPattern: " & its
SearchPattern
set end of patternList to "ReplacePattern: " & its
ReplacePattern
set end of patternList to ""
end tell
end repeat
set AppleScript's text item delimiters to return
set patternList to patternList as text
tell application "BBEdit"
activate
make new document with properties {text:patternList}
end tell
------------------------------------------------------------------------------
--
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>