minimal change to BBEdit script

minimal change to BBEdit script

-- BBEdit_upgrade_SQL_Query_to_newer_format({})
-- Dan Shockley, NYHTC
-- BBEdit - upgrade SQL Query to newer format

(*
HISTORY:
	1.0 - 2017-09-15 ( dshockley ): first created.
*)

on run
	BBEdit_upgrade_SQL_Query_to_newer_format({})
end run

--------------------
-- START OF CODE
--------------------

on BBEdit_upgrade_SQL_Query_to_newer_format({})

	set regexSearch_SQL_Table to "Quote *\\( *TableNameOfField *\\( *([^\\)]+) \\) *\\)"
	set regexReplace_SQL_Table to "SQL_Table ( \\1 )"

	set regexSearch_SQL_Field to "Quote *\\( ?FieldNameShort *\\( *([^\\)]+) \\) *\\)"
	set regexReplace_SQL_Field to "SQL_Field ( \\1 )"

	set regexSearch_WhereEqualsClause to "^([\\t ]*)& *SQL_Field *\\( *([^\\)]+)\\)
[\\t ]*& \" = \"
[\\t ]*& ([^\\r]+)\\r"

	set regexReplace_WhereEqualsClause to "\\1\\& SQL_Where ( \\2 ; \"=\" ; \\3 )\\r"

	tell application "BBEdit"
		activate

		tell window 1

			replace regexSearch_SQL_Table using regexReplace_SQL_Table options {search mode:grep, starting at top:true}

			replace regexSearch_SQL_Field using regexReplace_SQL_Field options {search mode:grep, starting at top:true}

			replace regexSearch_WhereEqualsClause using regexReplace_WhereEqualsClause options {search mode:grep, starting at top:true}

		end tell

	end tell
end BBEdit_upgrade_SQL_Query_to_newer_format

--------------------
-- END OF CODE
--------------------

-- BBEdit_upgrade_SQL_Query_to_newer_format({})
-- Dan Shockley, NYHTC
-- BBEdit - upgrade SQL Query to newer format

(*
HISTORY:
	1.0 - 2017-09-15 ( dshockley ): first created.
*)

on run
	TextWrangler_upgrade_SQL_Query_to_newer_format({})
end run

--------------------
-- START OF CODE
--------------------

on TextWrangler_upgrade_SQL_Query_to_newer_format({})

	set regexSearch_SQL_Table to "Quote *\\( *TableNameOfField *\\( *([^\\)]+) \\) *\\)"
	set regexReplace_SQL_Table to "SQL_Table ( \\1 )"

	set regexSearch_SQL_Field to "Quote *\\( ?FieldNameShort *\\( *([^\\)]+) \\) *\\)"
	set regexReplace_SQL_Field to "SQL_Field ( \\1 )"

	set regexSearch_WhereEqualsClause to "^([\\t ]*)& *SQL_Field *\\( *([^\\)]+)\\)
[\\t ]*& \" = \"
[\\t ]*& ([^\\r]+)\\r"

	set regexReplace_WhereEqualsClause to "\\1\\& SQL_Where ( \\2 ; \"=\" ; \\3 )\\r"

	tell application "BBEdit"
		activate

		tell window 1

			replace regexSearch_SQL_Table using regexReplace_SQL_Table options {search mode:grep, starting at top:true}

			replace regexSearch_SQL_Field using regexReplace_SQL_Field options {search mode:grep, starting at top:true}

			replace regexSearch_WhereEqualsClause using regexReplace_WhereEqualsClause options {search mode:grep, starting at top:true}

		end tell

	end tell
end TextWrangler_upgrade_SQL_Query_to_newer_format

--------------------
-- END OF CODE
--------------------


Source files don't need to be executable.

-- main.applescript
-- GrowlAction

on run {input_items, parameters}
	set the output_items to {}
	set the notification_title to (|notificationTitle| of parameters) as string
	set the notification_description to (description of parameters) as string
	set the notification_priority to (priority of parameters) as integer
	set the notification_sticky to (sticky of parameters) as boolean
	tell application "GrowlHelperApp"
		register as application "Automator" all notifications {"Automator notification"} default notifications {"Automator notification"}
		notify with name "Automator notification" title notification_title description notification_description application name "Automator" sticky notification_sticky priority notification_priority
	end tell
	return input_items
end run

on localized_string(key_string)
	return localized string key_string in bundle with identifier "com.growl.GrowlAction"
end localized_string


JasonLeyba: Make reinstall.scpt system language independent.

git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@16964 07704840-8298-11de-bf8c-fd130f914ac9

#!/usr/bin/osascript
(*
Copyright 2012 Software Freedom Conservancy. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)

(*
This script can be used to quickly re-install the SafariDriver extension
during development.

Requirements:
- The extension must be manually installed before use
- This script must be run from the trunk.
*)

-- Keep this in sync with the name of the extension in the Info.plist
set EXTENSION to "WebDriver"

tell application "System Events"
	set ui_elements_enabled to UI elements enabled
end tell

if ui_elements_enabled is false then
	tell application "System Preferences"
		activate
		set current pane to pane id "com.apple.preference.universalaccess"
		display dialog "Please \"Enable access for assistive devices\" " & ¬
			"and try again..."
		error number -128
	end tell
end if

tell application "Safari" to activate

tell application "System Events"
	tell process "Safari"
		tell menu bar 1
			-- tell menu "Develop"
			tell menu bar item 8
				tell menu 1
					-- click menu item "Show Extension Builder"
					click menu item 7
				end tell
			end tell
		end tell

		delay 0.2

		-- https://discussions.apple.com/thread/2726674?start=0&tstart=0
		-- tell UI element 1 of scroll area 1 of window "Extension Builder"
		tell UI element 1 of scroll area 1 of window 1
			set found_extension to false
			set tc to (count (groups whose its images is not {}))
			repeat with i from 1 to tc
				if exists (static text 1 of group i) then
					set t_name to name of static text 1 of group i
					if t_name is EXTENSION then
						set found_extension to true
						-- click button "Reload" of UI element ("ReloadUninstall" & t_name)
						click button 1 of UI element 4
						exit repeat
					end if
				end if
				keystroke (character id 31)
				delay 0.2
			end repeat

			if found_extension is false then
				display dialog "Was unable to locate the extension \"" & EXTENSION ¬
					& "\"" & return & return ¬
					& "It must be manually installed before this script may be used."
				error number -128
			end if
		end tell
	end tell
end tell

tell application "Safari" to quit

#!/usr/bin/osascript
(*
Copyright 2012 Software Freedom Conservancy. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)

(*
This script can be used to quickly re-install the SafariDriver extension
during development.

Requirements:
- The extension must be manually installed before use
- This script must be run from the trunk.
*)

-- Keep this in sync with the name of the extension in the Info.plist
set EXTENSION to "WebDriver"

tell application "System Events"
	set ui_elements_enabled to UI elements enabled
end tell

if ui_elements_enabled is false then
	tell application "System Preferences"
		activate
		set current pane to pane id "com.apple.preference.universalaccess"
		display dialog "Please \"Enable access for assistive devices\" " & ¬
		    "and try again..."
		error number -128
	end tell
end if

tell application "Safari" to activate

tell application "System Events"
	tell process "Safari"
		tell menu bar 1
			tell menu "Develop"
				click menu item "Show Extension Builder"
				delay 1
			end tell
		end tell

		-- https://discussions.apple.com/thread/2726674?start=0&tstart=0
		tell UI element 1 of scroll area 1 of window "Extension Builder"
			set found_extension to false
			set tc to (count (groups whose its images is not {}))
			repeat with i from 1 to tc
				if exists (static text 1 of group i) then
					set t_name to name of static text 1 of group i
					if t_name is EXTENSION then
						set found_extension to true
						click button "Reload" of UI element ("ReloadUninstall" & t_name)
						exit repeat
					end if
				end if
				keystroke (character id 31)
				delay 0.2
			end repeat

			if found_extension is false then
				display dialog "Was unable to locate the extension \"" & EXTENSION ¬
				    & "\"" & return & return ¬
				    & "It must be manually installed before this script may be used."
				error number -128
			end if
		end tell
	end tell
end tell

tell application "Safari" to quit


saving state before removing tmpFolder from PreCleanup and BuildDiskImage.

git-svn-id: c87f87383e9e570476b37173748f840982b11a31@232 a0cc1e66-070c-0410-9f8a-b213d8d4c38a

fxscriptcompiler/FXScript Disk Image Creator.applescript


upgrade ResetSafari.scpt

upgrade ResetSafari.scpt

FasdUAS 1.101.10
k
l	on run {}		on run {}

l
)#https://gist.github.com/3807895.git
Fhttps://gist.github.com/3807895.git
l
r
mSafari
o0appname
l
l$
Z$
I
0appisrunningappIsRunning
o0appname
k
  !"
!r
#$
#m

boovtrue
$o0started"%&
%l'('	 Quit App()) Quit App&*
*O+,
+I
.aevtquitnullnull
,4-

capp
-o0appname
r!$./
.m!"
boovfals
/o0started01
0l123
2l345
4l676-'tell application "Terminal" to activate788Ntell application "Terminal" to activate59:
9l:;<
;l%*=
=I%*>
.sysoexecTEXTTEXT
>m%&??@@rmv ~/Library/Safari ~/Desktop/Safari-`date +%Y%m%d%H%M%S`<AB
Al+0C
CI+0D
.sysoexecTEXTTEXT
Dm+,EEFFPrm -Rf ~/Library/Caches/com.apple.SafariBGH
Gl16I
II16J
.sysoexecTEXTTEXT
Jm12KKLLNrm -Rf ~/Library/Caches/Metadata/SafariHMN
Ml7<O
OI7<P
.sysoexecTEXTTEXT
Pm78QQRRPrm -Rf ~/Library/Caches/com.apple.SafariNST
Sl=BU
UI=BV
.sysoexecTEXTTEXT
Vm=>WWXXlrm -Rf ~/Library/Caches/com.apple.WebKit.PluginProcessTYZ
YlCH[
[ICH\
.sysoexecTEXTTEXT
\mCD]]^^\rm -Rf ~/Library/Cookies/Cookies.binarycookiesZ_`
_lINa
aIINb
.sysoexecTEXTTEXT
bmIJccddfrm -Rf ~/Library/Preferences/com.apple.Safari.plist`ef
elOTg
gIOTh
.sysoexecTEXTTEXT
hmOPiijjrm -Rf ~/Library/Preferences/com.apple.Safari.LSSharedFileList.plistfkl
klUZm
mIUZn
.sysoexecTEXTTEXT
nmUVooppnrm -Rf ~/Library/Preferences/com.apple.Safari.RSS.plistlqr
ql[bs
sI[bt
.sysoexecTEXTTEXT
tm[^uuvvfrm -Rf ~/Library/Preferences/com.apple.Safari.plistrwx
wlcjy
yIcjz
.sysoexecTEXTTEXT
zmcf{{||trm -Rf ~/Library/Preferences/com.apple.WebFoundation.plistx}~
}lkr
Ikr
.sysoexecTEXTTEXT
mkn|rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginHost.plist~
lsz
Isz
.sysoexecTEXTTEXT
msvrm -Rf ~/Library/Preferences/com.apple.WebKit.PluginProcess.plist
l{
I{
.sysoexecTEXTTEXT
m{~@rm -Rf ~/Library/PubSub/Database
l
I
.sysoexecTEXTTEXT
mHrm -f ~/Library/Safari/history.plist
l
I
.sysoexecTEXTTEXT
mLrm -f ~/Library/Safari/HistoryIndex.sk
l
I
.sysoexecTEXTTEXT
mHrm -rf ~/Library/Safari/LocalStorage
l
I
.sysoexecTEXTTEXT
mBrm -rf ~/Library/Safari/Databases
l
I
.sysoexecTEXTTEXT
m`rm -f ~/Library/Caches/com.apple.Safari/Cache.db
l
I
.sysoexecTEXTTEXT
mtrm -rf ~/Library/Caches/com.apple.Safari/Webpage\ Previews
l
I
.sysoexecTEXTTEXT
m^rm -rf ~/Library/Caches/Metadata/Safari/History
l
I
.sysoexecTEXTTEXT
mrm -Rf ~/Library/Saved Application State/com.apple.Safari.savedState/
l
l~
Z}|
o{{0started
O
Izyx
z.miscactvnullnullyx
4w
w
capp
ovv0appname}|~
lutsuts
i
Irqr0appisrunningappIsRunningp
ooo0appnamepq
O
E
l	nm
n
1	l
l
pnam
2k
k
prcsnm
o
jj0appname
msevsalisMacintosh HDϓ,XH+LSystem Events.appQ27	 CoreServicesϓd2wLLL=Macintosh HD:System:Library:CoreServices:System Events.app$System Events.appMacintosh HD-System/Library/CoreServices/System Events.app/
lihgihg
lfedfedc
lbb
end runend runcaa`_`0appisrunningappIsRunning
_.aevtoappnull****^]\[^0appisrunningappIsRunning]ZZYY0appname\XX0appnameWV
W
prcs
V
pnam[
	*-,UUTSR
U.aevtoappnull****
k;AGMSY_ekqw}QQTSPONML?KEKQW]ciou{JP0appnameO0appisrunningappIsRunningN0started
M
capp
L.aevtquitnullnull
K.sysoexecTEXTTEXT
J.miscactvnullnullREO*k+eEO*/*jUYfEOjOjOjOjOjOjOjOjOjOajOajOajOajOajOajOajOajOajOajOajOajOajO*/*jUYhascrޭ

FasdUAS 1.101.10
k
l	on run {}		on run {}

l

l
r
mSafari
o0appname

l
l$
Z$
I
0appisrunningappIsRunning
o0appname
k

r
 !
 m

boovtrue
!o0started"#
"l$%$	 Quit App%&& Quit App#'
'O()
(I
.aevtquitnullnull
)4*

capp
*o0appname
r!$+,
+m!"
boovfals
,o0started-.
-l./0
/l012
1l343-'tell application "Terminal" to activate455Ntell application "Terminal" to activate267
6l789
8l%*:
:I%*;
.sysoexecTEXTTEXT
;m%&<<==rmv ~/Library/Safari ~/Desktop/Safari-`date +%Y%m%d%H%M%S`9>?
>l+0@
@I+0A
.sysoexecTEXTTEXT
Am+,BBCCPrm -Rf ~/Library/Caches/com.apple.Safari?DE
Dl16F
FI16G
.sysoexecTEXTTEXT
Gm12HHIINrm -Rf ~/Library/Caches/Metadata/SafariEJK
Jl7<L
LI7<M
.sysoexecTEXTTEXT
Mm78NNOOPrm -Rf ~/Library/Caches/com.apple.SafariKPQ
Pl=BR
RI=BS
.sysoexecTEXTTEXT
Sm=>TTUUlrm -Rf ~/Library/Caches/com.apple.WebKit.PluginProcessQVW
VlCHX
XICHY
.sysoexecTEXTTEXT
YmCDZZ[[\rm -Rf ~/Library/Cookies/Cookies.binarycookiesW\]
\lIN^
^IIN_
.sysoexecTEXTTEXT
_mIJ``aafrm -Rf ~/Library/Preferences/com.apple.Safari.plist]bc
blOTd
dIOTe
.sysoexecTEXTTEXT
emOPffggrm -Rf ~/Library/Preferences/com.apple.Safari.LSSharedFileList.plistchi
hlUZj
jIUZk
.sysoexecTEXTTEXT
kmUVllmmnrm -Rf ~/Library/Preferences/com.apple.Safari.RSS.plistino
nl[bp
pI[bq
.sysoexecTEXTTEXT
qm[^rrssfrm -Rf ~/Library/Preferences/com.apple.Safari.plistotu
tlcjv
vIcjw
.sysoexecTEXTTEXT
wmcfxxyytrm -Rf ~/Library/Preferences/com.apple.WebFoundation.plistuz{
zlkr|
|Ikr}
.sysoexecTEXTTEXT
}mkn~~|rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginHost.plist{
lsz
Isz
.sysoexecTEXTTEXT
msvrm -Rf ~/Library/Preferences/com.apple.WebKit.PluginProcess.plist
l{
I{
.sysoexecTEXTTEXT
m{~@rm -Rf ~/Library/PubSub/Database
l
I
.sysoexecTEXTTEXT
mHrm -f ~/Library/Safari/history.plist
l
I
.sysoexecTEXTTEXT
mLrm -f ~/Library/Safari/HistoryIndex.sk
l
I
.sysoexecTEXTTEXT
mHrm -rf ~/Library/Safari/LocalStorage
l
I
.sysoexecTEXTTEXT
mBrm -rf ~/Library/Safari/Databases
l
I
.sysoexecTEXTTEXT
m`rm -f ~/Library/Caches/com.apple.Safari/Cache.db
l
I
.sysoexecTEXTTEXT
mtrm -rf ~/Library/Caches/com.apple.Safari/Webpage\ Previews
l
I
.sysoexecTEXTTEXT
m^rm -rf ~/Library/Caches/Metadata/Safari/History
l
I
.sysoexecTEXTTEXT
mrm -Rf ~/Library/Saved Application State/com.apple.Safari.savedState/
l~~
l}|
Z{z
oyy0started
O
Ixwv
x.miscactvnullnullwv
4u
u
capp
ott0appname{z}|
lsrqsrq
i
Ipop0appisrunningappIsRunningn
omm0appnameno
O
E
l	lk
n
1	j
j
pnam
2i
i
prcslk
o
hh0appname
msevsalisMacintosh HDϓ,XH+LSystem Events.appQ27	 CoreServicesϓd2wLLL=Macintosh HD:System:Library:CoreServices:System Events.app$System Events.appMacintosh HD-System/Library/CoreServices/System Events.app/
lgfegfe
ldcbdcba
l``
end runend runa_^_]\[Z]0appisrunningappIsRunning
\.aevtoappnull****[0appnameZ0startedYXWVY0appisrunningappIsRunningXUUTT0appnameWSS0appnameRQ
R
prcs
Q
pnamV
	*-,UPONM
P.aevtoappnull****
k8>DJPV\bhntzLLONKJIHG<FBHNTZ`flrx~EK0appnameJ0appisrunningappIsRunningI0started
H
capp
G.aevtquitnullnull
F.sysoexecTEXTTEXT
E.miscactvnullnullMEO*k+eEO*/*jUYfEOjOjOjOjOjOjOjOjOjOajOajOajOajOajOajOajOajOajOajOajOajOajO*/*jUYh
^boovtrueascr
ޭ


Delete Shutdown.applescript

Delete Shutdown.applescript

tell application "Finder"
	shutdown
end tell


ScriptEditor messed with the line endings :/

tell application "System Events" to set SkypeIsRunning to (count of (every process whose name is "Skype")) > 0
if SkypeIsRunning then
  tell application "Skype"
    send command "SET USERSTATUS ONLINE" script name "SETSKYPESTATUSTOONLINE"
  end tell
end if