Return to Snippet

Revision: 58220
at July 2, 2012 05:30 by page_lab


Initial Code
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 its Title
		set end of patternList to its SearchPattern
		set end of patternList to 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

Initial URL

                                

Initial Description

                                

Initial Title
Save all BBEdit GREP Patterns in a  file

Initial Tags

                                

Initial Language
AppleScript