BBEdit Upgrade Query - disabled potentially dangerous convert-to-List code

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

(*
HISTORY:
	1.7 - 2019-04-25 ( dshockley ): Added error-trapping and handling. The param for the handler is now named prefs instead of accidentally being an empty list. Disabled potentially-problematic "convert to using List for query whitespace formatting" code!
	1.6 - 2019-04-17 ( dshockley ): Added ExecuteOLD2. Added SemicolonPilcrowLine.
	1.5 - 2019-04-05 ( dshockley ): Added literalSearch_SpacesToTabs. Fixed "using List for query". Other minor changes. Disabled RemoveExtraSpacesBeforeSemicolon. Added RemoveSpacesBetweenLeadingTabsAndSemicolon.
	1.4 - 2019-01-02 ( dshockley ): Added ExecuteOLD, QuotedPilcrow, IfSqlResultOLD, queryDebugOLD.
	1.3 - 2018-09-04 ( dshockley ): Added regex to remove extra spaces before semicolons. Fix for optional space at end of SQL_Field line in whereEqualsClause regex search.
	1.2 - 2018-05-22 ( dshockley ): modified to also convert the query to use List to separate the components of the query.
	1.1 - 2017-12-11 ( dshockley ): disable the usually no-longer-needed SQL_EscapeString, but WARN and comment, since it might sitll be needed when using with something OTHER THAN SQL_Where criteria.
	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(prefs)

	try

		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 *\\( *([^\\)]+) *\\) *\\r[\\t ]*& \" *([=<>]+) *\" ?\\r[\\t ]*& ([^\\r\\n]+)\\r"

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

		set regexSearch_EscapeStringWARN to "SQL_EscapeString *\\( *([^\\)]+) *\\)"

		set regexReplace_EscapeStringWARN to "\\1 /* WARNING!! Had SQL_EscapeString probably NO LONGER NEEDED, so DISABLED! */"

		-- NOT SURE THIS IS NEEDED (or a good idea, since there might be matching DESIRED patterns inside quotes):
		--	set regexSearch_RemoveExtraSpacesBeforeSemicolon to "([^;])  +;"
		--	set regexReplace_RemoveExtraSpacesBeforeSemicolon to "\\1 ;"

		set regexSearch_RemoveSpacesBetweenLeadingTabsAndSemicolon to "^([	]+)[ ]+;"
		set regexReplace_RemoveSpacesBetweenLeadingTabsAndSemicolon to "\\1;"

		-- LITERAL SECTION:

		set literalSearch_SpacesToTabs to "       "
		set literalReplace_SpacesToTabs to ASCII character 9

		set literalSearch_ExecuteOLD1 to "sqlResult = HTC_ExecuteFileSQL ( sqlQuery; \"\"; \";\"; \"\" )"
		set literalReplace_ExecuteOLD1 to "sqlResult = HTC_ExecuteFileSQL ( sqlQuery ; \"\" ; \";\" ; Char ( 13 ) )"

		set literalSearch_ExecuteOLD2 to "HTC_ExecuteFileSQL ( sqlQuery; \"\"; Char ( 9 ); \"\" )"
		set literalReplace_ExecuteOLD2 to "HTC_ExecuteFileSQL ( sqlQuery ; \"\" ; Char ( 9 ) ; Char ( 13 ) )"

		set literalSearch_IfSqlResultOLD to "If ( sqlResult = \"?\"; \"\"; sqlResult )"
		set literalReplace_IfSqlResultOLD to "If ( sqlResult = \"?\" ; \"\" ; sqlResult )"

		set literalSearch_queryDebugOLD1 to "sqlQuery & \"==========\" &"
		set literalSearch_queryDebugOLD2 to "sqlQuery & \"==========\" &"
		set literalReplace_queryDebugOLD to "sqlQuery & Char ( 13 ) &  \"==========\" & Char ( 13 ) &" & return

		set literalSearch_QuotedPilcrow to "\"\""
		set literalReplace_QuotedPilcrow to "Char ( 13 )"

		-- FINAL CLEANUP REGEX:

		set regexSearch_SemicolonPilcrowLine to "^\\t+; [ \\t]*\\r"
		set regexReplace_SemicolonPilcrowLine to ""

		tell application "BBEdit"
			activate
			delay 0.1 -- make sure script has time to start??

			tell window 1

				replace literalSearch_SpacesToTabs using literalReplace_SpacesToTabs options {search mode:literal, starting at top:true}

				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}

				replace regexSearch_EscapeStringWARN using regexReplace_EscapeStringWARN options {search mode:grep, starting at top:true}

				replace regexSearch_RemoveSpacesBetweenLeadingTabsAndSemicolon using regexReplace_RemoveSpacesBetweenLeadingTabsAndSemicolon options {search mode:grep, starting at top:true}

				-- NOT SURE THIS IS NEEDED (or a good idea, since there might be matching DESIRED patterns inside quotes):
				--			replace regexSearch_RemoveExtraSpacesBeforeSemicolon using regexReplace_RemoveExtraSpacesBeforeSemicolon options {search mode:grep, starting at top:true}

				replace literalSearch_ExecuteOLD1 using literalReplace_ExecuteOLD1 options {search mode:literal, starting at top:true}
				replace literalSearch_ExecuteOLD2 using literalReplace_ExecuteOLD2 options {search mode:literal, starting at top:true}

				replace literalSearch_IfSqlResultOLD using literalReplace_IfSqlResultOLD options {search mode:literal, starting at top:true}
				replace literalSearch_queryDebugOLD1 using literalReplace_queryDebugOLD options {search mode:literal, starting at top:true}
				replace literalSearch_queryDebugOLD2 using literalReplace_queryDebugOLD options {search mode:literal, starting at top:true}
				replace literalSearch_QuotedPilcrow using literalReplace_QuotedPilcrow options {search mode:literal, starting at top:true}

				(* DISABLED, SINCE IT CAN MANGLE INTERNAL 'IF' blocks:
				EXAMPLE (the IF line SQL_Where gets put as the ELSE, instead of staying with " AND "!!!!):
	; sqlQuery =
		"SELECT "
				& SQL_Field ( LR_LOCAL_REPORT::aLR__PrimaryKey )

			& " FROM "
				& SQL_Table ( LR_LOCAL_REPORT::zAuto1 )

			& " WHERE "
				& SQL_Where ( LR_LOCAL_REPORT::aLR_UID ; "=" ; UID )

			& " AND "
				& SQL_Where ( LR_LOCAL_REPORT::aLR_LocalKey ; "=" ; localKey )

			& " AND "
				& SQL_Where ( LR_LOCAL_REPORT::bLR_DateReportFor_Month1st ; ">=" ; dateMonthFor )

			& If ( not IsEmpty ( dateAcctPeriod )
				; " AND "
					& SQL_Where ( LR_LOCAL_REPORT::bLR_DateAccountingPeriod_Month1st ; ">=" ; dateAcctPeriod )
				)

				try
					(* convert to using List for query whitespace formatting: *)
					set stringStartQuery to ";? ?sqlQuery = "
					set stringEndQuery to "^([\\t ]+); sqlResult = "
					set posQueryStart to characterOffset of found object of (find stringStartQuery options {search mode:grep, starting at top:true})
					set posQueryEnd to (characterOffset of found object of (find stringEndQuery options {search mode:grep, starting at top:true})) - 1
					select (characters posQueryStart through posQueryEnd)

					replace "\"SELECT" using "List ( \\r\\t\\t\\t  \"SELECT" searching in selection options {search mode:grep}
					replace "^([\\t ]+)& " using "\\t\\t\\t; " searching in selection options {search mode:grep}

					-- because changing the contents of the selection changes the position of the end, get the new end:
					set posQueryEnd_NEW to (characterOffset of selection) + (length of selection) - 1

					set character posQueryEnd_NEW to return & tab & tab & tab & ")" & (contents of character posQueryEnd_NEW) & return

				end try
				*)

				replace regexSearch_SemicolonPilcrowLine using regexReplace_SemicolonPilcrowLine options {search mode:grep, starting at top:true}

			end tell

		end tell

	on error errMsg number errNum
		tell application "BBEdit" to display dialog "Upgrade SQL Query: ERROR: " & errMsg & " - number: " & errNum
	end try

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.7 - 2019-04-25 ( dshockley ): Added error-trapping and handling. The param for the handler is now named prefs instead of accidentally being an empty list.
	1.6 - 2019-04-17 ( dshockley ): Added ExecuteOLD2. Added SemicolonPilcrowLine.
	1.5 - 2019-04-05 ( dshockley ): Added literalSearch_SpacesToTabs. Fixed "using List for query". Other minor changes. Disabled RemoveExtraSpacesBeforeSemicolon. Added RemoveSpacesBetweenLeadingTabsAndSemicolon.
	1.4 - 2019-01-02 ( dshockley ): Added ExecuteOLD, QuotedPilcrow, IfSqlResultOLD, queryDebugOLD.
	1.3 - 2018-09-04 ( dshockley ): Added regex to remove extra spaces before semicolons. Fix for optional space at end of SQL_Field line in whereEqualsClause regex search.
	1.2 - 2018-05-22 ( dshockley ): modified to also convert the query to use List to separate the components of the query.
	1.1 - 2017-12-11 ( dshockley ): disable the usually no-longer-needed SQL_EscapeString, but WARN and comment, since it might sitll be needed when using with something OTHER THAN SQL_Where criteria.
	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(prefs)

	try

		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 *\\( *([^\\)]+) *\\) *\\r[\\t ]*& \" *([=<>]+) *\" ?\\r[\\t ]*& ([^\\r\\n]+)\\r"

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

		set regexSearch_EscapeStringWARN to "SQL_EscapeString *\\( *([^\\)]+) *\\)"

		set regexReplace_EscapeStringWARN to "\\1 /* WARNING!! Had SQL_EscapeString probably NO LONGER NEEDED, so DISABLED! */"

		-- NOT SURE THIS IS NEEDED (or a good idea, since there might be matching DESIRED patterns inside quotes):
		--	set regexSearch_RemoveExtraSpacesBeforeSemicolon to "([^;])  +;"
		--	set regexReplace_RemoveExtraSpacesBeforeSemicolon to "\\1 ;"

		set regexSearch_RemoveSpacesBetweenLeadingTabsAndSemicolon to "^([	]+)[ ]+;"
		set regexReplace_RemoveSpacesBetweenLeadingTabsAndSemicolon to "\\1;"

		-- LITERAL SECTION:

		set literalSearch_SpacesToTabs to "       "
		set literalReplace_SpacesToTabs to ASCII character 9

		set literalSearch_ExecuteOLD1 to "sqlResult = HTC_ExecuteFileSQL ( sqlQuery; \"\"; \";\"; \"\" )"
		set literalReplace_ExecuteOLD1 to "sqlResult = HTC_ExecuteFileSQL ( sqlQuery ; \"\" ; \";\" ; Char ( 13 ) )"

		set literalSearch_ExecuteOLD2 to "HTC_ExecuteFileSQL ( sqlQuery; \"\"; Char ( 9 ); \"\" )"
		set literalReplace_ExecuteOLD2 to "HTC_ExecuteFileSQL ( sqlQuery ; \"\" ; Char ( 9 ) ; Char ( 13 ) )"

		set literalSearch_IfSqlResultOLD to "If ( sqlResult = \"?\"; \"\"; sqlResult )"
		set literalReplace_IfSqlResultOLD to "If ( sqlResult = \"?\" ; \"\" ; sqlResult )"

		set literalSearch_queryDebugOLD1 to "sqlQuery & \"==========\" &"
		set literalSearch_queryDebugOLD2 to "sqlQuery & \"==========\" &"
		set literalReplace_queryDebugOLD to "sqlQuery & Char ( 13 ) &  \"==========\" & Char ( 13 ) &" & return

		set literalSearch_QuotedPilcrow to "\"\""
		set literalReplace_QuotedPilcrow to "Char ( 13 )"

		-- FINAL CLEANUP REGEX:

		set regexSearch_SemicolonPilcrowLine to "^\\t+; [ \\t]*\\r"
		set regexReplace_SemicolonPilcrowLine to ""

		tell application "BBEdit"
			activate
			delay 0.1 -- make sure script has time to start??

			tell window 1

				replace literalSearch_SpacesToTabs using literalReplace_SpacesToTabs options {search mode:literal, starting at top:true}

				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}

				replace regexSearch_EscapeStringWARN using regexReplace_EscapeStringWARN options {search mode:grep, starting at top:true}

				replace regexSearch_RemoveSpacesBetweenLeadingTabsAndSemicolon using regexReplace_RemoveSpacesBetweenLeadingTabsAndSemicolon options {search mode:grep, starting at top:true}

				-- NOT SURE THIS IS NEEDED (or a good idea, since there might be matching DESIRED patterns inside quotes):
				--			replace regexSearch_RemoveExtraSpacesBeforeSemicolon using regexReplace_RemoveExtraSpacesBeforeSemicolon options {search mode:grep, starting at top:true}

				replace literalSearch_ExecuteOLD1 using literalReplace_ExecuteOLD1 options {search mode:literal, starting at top:true}
				replace literalSearch_ExecuteOLD2 using literalReplace_ExecuteOLD2 options {search mode:literal, starting at top:true}

				replace literalSearch_IfSqlResultOLD using literalReplace_IfSqlResultOLD options {search mode:literal, starting at top:true}
				replace literalSearch_queryDebugOLD1 using literalReplace_queryDebugOLD options {search mode:literal, starting at top:true}
				replace literalSearch_queryDebugOLD2 using literalReplace_queryDebugOLD options {search mode:literal, starting at top:true}
				replace literalSearch_QuotedPilcrow using literalReplace_QuotedPilcrow options {search mode:literal, starting at top:true}

				try
					(* convert to using List for query whitespace formatting: *)
					set stringStartQuery to ";? ?sqlQuery = "
					set stringEndQuery to "^([\\t ]+); sqlResult = "
					set posQueryStart to characterOffset of found object of (find stringStartQuery options {search mode:grep, starting at top:true})
					set posQueryEnd to (characterOffset of found object of (find stringEndQuery options {search mode:grep, starting at top:true})) - 1
					select (characters posQueryStart through posQueryEnd)

					replace "\"SELECT" using "List ( \\r\\t\\t\\t  \"SELECT" searching in selection options {search mode:grep}
					replace "^([\\t ]+)& " using "\\t\\t\\t; " searching in selection options {search mode:grep}

					-- because changing the contents of the selection changes the position of the end, get the new end:
					set posQueryEnd_NEW to (characterOffset of selection) + (length of selection) - 1

					set character posQueryEnd_NEW to return & tab & tab & tab & ")" & (contents of character posQueryEnd_NEW) & return

				end try

				replace regexSearch_SemicolonPilcrowLine using regexReplace_SemicolonPilcrowLine options {search mode:grep, starting at top:true}

			end tell

		end tell

	on error errMsg number errNum
		tell application "BBEdit" to display dialog "Upgrade SQL Query: ERROR: " & errMsg & " - number: " & errNum
	end try

end BBEdit_upgrade_SQL_Query_to_newer_format

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


- from Br'fin, patch #642397: Applescript:Fix to handle spaces in path   This patch fixes bochs.applescript to handle a case where there are   spaces in the current path.

property bochs_path : "bochs.app/Contents/MacOS/bochs"

set script_name to name of (info for (path to me))
set script_path to POSIX path of (path to me)

-- replace target string using delimiters
set AppleScript's text item delimiters to the script_name
set the text_item_list to every text item of the script_path
set AppleScript's text item delimiters to ""
set the script_path to the text_item_list as string

tell application "Terminal"
	activate
	do script "cd \"" & script_path & "\";" & bochs_path
	-- Wait for Terminal to change the name first, then change it to ours
	delay 1
	set AppleScript's text item delimiters to "/"
	set the text_item_list to every text item of the script_path
	set AppleScript's text item delimiters to ""
	set next_to_last to ((count of text_item_list) - 1)
	set the folder_name to item next_to_last of text_item_list
	set name of front window to "Running bochs in ../" & folder_name & "/"
end tell

property bochs_path : "bochs.app/Contents/MacOS/bochs"

set script_name to name of (info for (path to me))
set script_path to POSIX path of (path to me)

-- replace target string using delimiters
set AppleScript's text item delimiters to the script_name
set the text_item_list to every text item of the script_path
set AppleScript's text item delimiters to ""
set the script_path to the text_item_list as string

tell application "Terminal"
	activate
	do script "cd " & script_path & ";" & bochs_path
	-- Wait for Terminal to change the name first, then change it to ours
	delay 1
	set AppleScript's text item delimiters to "/"
	set the text_item_list to every text item of the script_path
	set AppleScript's text item delimiters to ""
	set next_to_last to ((count of text_item_list) - 1)
	set the folder_name to item next_to_last of text_item_list
	set name of front window to "Running bochs in ../" & folder_name & "/"
end tell


updated iCal AppleScript - better event searching, and warning about missing repeat events

--HG--
extra : convert_revision : svn%3A99687598-2e92-11dd-8019-fe7b9d601d1b/trunk%401353

FasdUAS 1.101.10
k
lQK	An applescript that shows today's events from iCal as growl notifications.
l

a[	The script shows how to register and use multiple types of notifications from Applescript:
l

l		"Today's Events"
l			and
l!		"In-Script Notifications"
lD>			are the two notification types that this script registers.
l@: 			The types of notification are separated functionally.
l|v 			So the user can disable the first informational note from the prefpane without disabling the main notifications.
l!!tn-------------------------------------------------------------------------------------------------------------- "#
"l$$tn--------------------------------------------------------------------------------------------------------------#%&
%l&'(
'l()*
)l*+,
+l--A;	Register with growl and show the "gathering" notification.,./
.l20
0O212
1k13345
4l567
6O89
8k::;<
;r=>
=J??@A
@m	BBToday's EventsAC
Cm
DDIn-Script Notification
>o 0myallnoteslistmyAllNotesList<E
EIF
.registernullnullFGH

appl
GmII-'AppleScript iCal today's Event NotifierHJK

anot
Jo 0myallnoteslistmyAllNotesListKLM

dnot
Lo 0myallnoteslistmyAllNotesListMN

iapp
NmOO
iCal
9mPPLnull߀OGrowlHelperApp.appL7@p)(K GRRRalisWideBoy.1H+OGrowlHelperApp.appO)	 	Resources.1)OOO+m|bWideBoy:Users:diggory:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.appWideBoyZUsers/diggory/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/7QR
QlRS
SI1T
.notifygrnullnullTUV

name
Ul	 !W
Wm !XXIn-Script NotificationVYZ

titl
Yl	"#[
[m"#\\Please WaitZ]^

desc
]l	&)_
_m&)``^XGathering today's events from iCal... (n.b. Events which are repeats will not be shown!)^a

appl
am*-bb-'AppleScript iCal today's Event Notifier
2mP/cd
cldef
elfgh
glhij
il3<k
kr3<lm
lI38
.misccurdldt null
mo0nowjno
nl=|p
pr=|qr
qc=xst
sl=tu
ub=tvw
vb=pxy
xb=lz{
zb=d|}
|b=`~
~b=X
b=T
b=L
b=H
m=@"
n@G
mCG

wkdy
o@C0now
mHK,
nLS
mOS

mnth
oLO0now
mTW
nX_
1[_

day
oX[0now
}m`c,
{ndk
1gk

year
odg0now
ymlo 12:00:00 am
wmps"
tmtw

TEXT
ro0morningtimemorningTimeo
l}
r}
4}

ldt
o0morningtimemorningTime
o0thismorningthisMorning
l
I
.ascrcmnt********
l
o0thismorningthisMorning
l
r
c
l
b
b
b
b
b
b
b
b
b
m"
n
m

wkdy
o0now
m,
n
m

mnth
o0now
m
n
1

day
o0now
m,
n
1

year
o0now
m 11:59:59 pm
m"
m

TEXT
o0eveningtimeeveningTime
l
r
4

ldt
o0eveningtimeeveningTime
o0thiseveningthisEvening
l
I
.ascrcmnt********
l
o0thiseveningthisEvening
l
l
l	Gather today's events
l
O
k
l
r
2

wres
o0
everycalendar
everyCalendar
l
r
c
J
m

list
o0
currentevents
currentEvents
Y&
k!
r#
n
4

cobj
o0i
o0
everycalendar
everyCalendar
o0thiscalthisCal
l$$
O$!
k*
r*3
2*/

wrev
o0
everyevent
everyEvent
Y4 	~
kI

rIU

nIQ
4LQ}
}
cobj
oOP||0ii
oIL{{0
everyevent
everyEvent
ozz0	thisevent	thisEventy
OV
k\
l\\xwxw
l\\vv$	Catch events that start today
r\a
m\]u
uboovfals
ott 0eventiscurrenteventIsCurrent
Zb!"sr
!Fb{#$
#lbk%q
%?bk&'
&1bgp
p
wr1s
'ogjoo0thismorningthisMorningq
$lnw(n
(Anw)*
)1nsm
m
wr1s
*osvll0thiseveningthisEveningn
"r~+,
+m~k
kboovtrue
,ojj 0eventiscurrenteventIsCurrentsr -.
-lihih./0
/lg1g1F@	Catch events that started before today, but have not yet ended.023
2Z45fe
4F67
6l8d
8?9:
91c
c
wr5s
:obb0nowd
7l;a
;A<=
<1`
`
wr1s
=o__0thismorningthisMorninga
5r>?
>m^
^boovtrue
?o]] 0eventiscurrenteventIsCurrentfe3@A
@l\[\[ABC
BlZYZYCDE
DZFGXW
FlHV
H=IJ
IoUU 0eventiscurrenteventIsCurrent
JmT
TboovtrueV
GkKKLM
LISNR
S.ascrcmnt********
NlOQ
OmPPCURRENT EVENT!QRMQR
QrST
S1P
P
wr1s
ToOO0thestarttheStartRUV
UrWX
WnYZ
Y1N
N
tstr
ZoMM0thestarttheStart
XoLL0thestarttimetheStartTimeV[\
[r]^
]c_`
_KaaKbcK0
eventtitle
eventTitle
bnde
d1J
J
wr11
eoII0	thisevent	thisEventcHfgH$0eventdescriptioneventDescription
fnhi
h1G
G
wr12
ioFF0	thisevent	thisEventgEjDE0	starttime	startTime
joCC0thestarttimetheStartTimeD
`mB
B
reco
^oAA0myrecordmyRecord\kl
krmn
mcop
oJqqr@
ro??0myrecordmyRecord@
pm>
>
list
no==0newlistnewListls<
sr	tu
tb	vw
vo	;;0
currentevents
currentEvents
wo::0newlistnewList
uo990
currentevents
currentEvents<XWExy
xl8787yz6
zl54546
oVY330	thisevent	thisEventy0ii
m7822
	n8D{|
{m?C1
1
nmbr
|n8?}~
}2;?0
0
cobj
~o8;//0
everyevent
everyEvent~
o$'..0thiscalthisCal0i
m--
n
m
,
,
nmbr
n

2
+
+
cobj
o	**0
everycalendar
everyCalendar
l'')()(
l'''&'&
l''%%	Show the events.
Y'$#
k<
r<H
n<D
4?D"
"
cobj
oBC!!0i
o<?  0
currentevents
currentEvents
o"0thiseventrecordthisEventRecord
QIz
rLc
lL_
bL_
bLW
nLS
oOS0
eventtitle
eventTitle
oLO"0thiseventrecordthisEventRecord
mSV	 -
nW^
oZ^0	starttime	startTime
oWZ"0thiseventrecordthisEventRecord
o"0theeventsummarytheEventSummary
R
.ascrerr ********
rkz
bkv
mkn
no summary -
nnu
oqu0	starttime	startTime
onq"0thiseventrecordthisEventRecord
o"0theeventsummarytheEventSummary
l{{
Q{
r~
n~
o$0eventdescriptioneventDescription
o~"0thiseventrecordthisEventRecord
o*0theeventdescriptiontheEventDescription
R

.ascrerr ********
r
mno description
o

*0theeventdescriptiontheEventDescription
l
O
l
I
.notifygrnullnull

name
l
mToday's Events

titl
l
o"0theeventsummarytheEventSummary

desc
l
o*0theeventdescriptiontheEventDescription

appl
m-'AppleScript iCal today's Event Notifier
mP$0i
m*+
n+7
m26

nmbr
n+2
2.2

cobj
o+.0
currentevents
currentEvents#
l
mnull߀^iCal.app`0L7֐0p)(K ְwrbtalis6WideBoy.1H+^iCal.app	 Applications.1^WideBoy:Applications:iCal.appiCal.appWideBoyApplications/iCal.app/
l
l
.aevtoappnull****
.aevtoappnull****
k.in0i0iiSPBDIOX\`bP 0myallnoteslistmyAllNotesList

appl

anot

dnot

iapp
.registernullnull

name

titl

desc
.notifygrnullnull
.misccurdldt null0now

wkdy

mnth

day

year

TEXT0morningtimemorningTime

ldt 0thismorningthisMorning
.ascrcmnt********0eveningtimeeveningTime0thiseveningthisEvening

wres0
everycalendar
everyCalendar

list0
currentevents
currentEvents

cobj

nmbr0thiscalthisCal

wrev0
everyevent
everyEvent0	thisevent	thisEvent 0eventiscurrenteventIsCurrent

wr1s

bool

wr5s0thestarttheStart

tstr0thestarttimetheStartTime0
eventtitle
eventTitle

wr11$0eventdescriptioneventDescription

wr120	starttime	startTime

reco0myrecordmyRecord0newlistnewList"0thiseventrecordthisEventRecord"0theeventsummarytheEventSummary*0theeventdescriptiontheEventDescription/lvEO*UO*aaaUO*jE`Oa_a,%a%_a,%a%_a,%a%_a,%a%a%a &E`!O*a"_!/E`#O_#j$Oa%_a,%a&%_a,%a'%_a,%a(%_a,%a)%a*%a &E`+O*a"_+/E`,O_,j$Oa-*a.-E`/Ojva0&E`1O#k_/a2-a3,Ekh_/a2/E`4O_4*a5-E`6Ok_6a2-a3,Ekh_6a2/E`7O_7fE`8O*a9,_#	*a9,_,a:&
eE`8YhO*a;,_	*a9,_#a:&
eE`8YhO_8eca<j$O*a9,E`=O_=a>,E`?Oa@_7aA,aB_7aC,aD_?aEaF&E`GO_Gkva0&E`HO_1_H%E`1YhOPU[OY(U[OYOk_1a2-a3,Ekh_1a2/E`IO_Ia@,aJ%_IaD,%E`KWXLMaN_IaD,%E`KO_IaB,E`OWXLMaPE`OO*aQ_Ka_OaRU[OYOPUascr
ޭ

FasdUAS 1.101.10
k
lQK	An applescript that shows today's events from iCal as growl notifications.
l

a[	The script shows how to register and use multiple types of notifications from Applescript:
l

l		"Today's Events"
l			and
l!		"In-Script Notifications"
lD>			are the two notification types that this script registers.
l@: 			The types of notification are separated functionally.
l|v 			So the user can disable the first informational note from the prefpane without disabling the main notifications.
l!!tn-------------------------------------------------------------------------------------------------------------- "#
"l$$tn--------------------------------------------------------------------------------------------------------------#%&
%l&'(
'l()*
)l*+,
+l--A;	Register with growl and show the "gathering" notification.,./
.l20
0O212
1k13345
4l567
6O89
8k::;<
;r=>
=J??@A
@m	BBToday's EventsAC
Cm
DDIn-Script Notification
>o 0myallnoteslistmyAllNotesList<E
EIF
.registernullnullFGH

appl
GmII-'AppleScript iCal today's Event NotifierHJK

anot
Jo 0myallnoteslistmyAllNotesListKLM

dnot
Lo 0myallnoteslistmyAllNotesListMN

iapp
NmOO
iCal
9mPPnull߀OGrowlHelperApp.appL7p)(K GRRRalisWideBoy.1H+OGrowlHelperApp.appO{&݇	 build.1&݇ON>//|DWideBoy:Users:diggory:Code:OpenSource:growl:build:GrowlHelperApp.app&GrowlHelperApp.appWideBoy<Users/diggory/Code/OpenSource/growl/build/GrowlHelperApp.app/7QR
QlRS
SI1T
.notifygrnullnullTUV

name
Ul	 !W
Wm !XXIn-Script NotificationVYZ

titl
Yl	"#[
[m"#\\Please WaitZ]^

desc
]l	&)_
_m&)``+%Gathering today's events from iCal...^a

appl
am*-bb-'AppleScript iCal today's Event Notifier
2mP/cd
cldef
elfgh
glhij
iljkl
klmm	Gather today's eventslno
nl3p
pO3qr
qk9sstu
tr9Bvw
vI9>
.misccurdldt null
wo0nowuxy
xrCLz{
z2CH

wres
{o0
everycalendar
everyCalendary|}
|lMM}~
~rMW
cMS
JMO
mOR

list
o0
currentevents
currentEvents
YX
km
rmy
nmu
4pu

cobj
ost0i
omp0
everycalendar
everyCalendar
o0thiscalthisCal
lzz
Oz
k
r
2

wrev
o0
everyevent
everyEvent
Y
k

r
n
4

cobj
o0ii
o0
everyevent
everyEvent
o0	thisevent	thisEvent
O

k
l
Z
A
1

wr1s
o0now
Z
?
1

wr5s
o0now
k
l#	This checking is pretty bad
lB<    events today that have already elapsed are not included.
l
l$	log ("CURRENT EVENT!")
r
c
K0
eventtitle
eventTitle
n
1

wr11
o0	thisevent	thisEvent$0eventdescriptioneventDescription
n
1

wr12
o0	thisevent	thisEvent
m

reco
o0myrecordmyRecord
r
c
J
o0myrecordmyRecord
m

list
o0newlistnewList
r
b
o0
currentevents
currentEvents
o0newlistnewList
o0
currentevents
currentEvents
o0	thisevent	thisEvent0ii
m
n
m

nmbr
n
2

cobj
o0
everyevent
everyEvent
oz}0thiscalthisCal0i
m[\
n\h
mcg

nmbr
n\c
2_c~
~
cobj
o\_}}0
everycalendar
everyCalendar
l|{|{
lzyzy
lxx	Show the events.
Ywv
k.
r.:
n.6
416u
u
cobj
o45tt0i
o.1ss0
currentevents
currentEvents
orr"0thiseventrecordthisEventRecord
Q;X
r>I
n>E
oAEqq0
eventtitle
eventTitle
o>App"0thiseventrecordthisEventRecord
ooo"0theeventsummarytheEventSummary
Rnml
n.ascrerr ********ml
rQX
mQT
no summary
okk"0theeventsummarytheEventSummary
lYYjiji
QYv

	r\g

n\c
o_chh$0eventdescriptioneventDescription
o\_gg"0thiseventrecordthisEventRecord

off*0theeventdescriptiontheEventDescription

Redc
e.ascrerr ********dc
rov
morno description
obb*0theeventdescriptiontheEventDescription
lwwa`a`_
Ow
l	{^
I{]\
].notifygrnullnull\[
[
name
l	}Z
m}Today's EventsZY
Y
titl
l	 X
 oWW"0theeventsummarytheEventSummaryXV!"
V
desc
!l	#U
#oTT*0theeventdescriptiontheEventDescriptionU"S$R
S
appl
$m%%-'AppleScript iCal today's Event NotifierR^
mwxP_w0i
mQQ
n)&'
&m$(P
P
nmbr
'n$()
(2 $O
O
cobj
)o NN0
currentevents
currentEventsv*+
*lMLML+,-
,lKJKJ-./
.lI0I0#	explain if there aren't any:/12
1lHGHG234
3Z56FE
5=78
7l9D
9n:;
:mC
C
nmbr
;n<=
<2B
B
cobj
=oAA0
currentevents
currentEventsD
8m@@
6k>>?@
?OAB
Al	C?
CI>=D
>.notifygrnullnull=D<EF
<
name
El	G;
GmHHIn-Script Notification;F:IJ
:
titl
Il	K9
KmLL	No Events9J8MN
8
desc
Ml	O7
OmPP>8There are no events in iCal today - go outside and play!7N6Q5
6
appl
QmRR-'AppleScript iCal today's Event Notifier5?
BmP@S4
Sl32324FE4T1
Tl0/0/1
rm36UUnull߀^iCal.appPP0`U0e(-lwrbtalis6WideBoy.1H+^iCal.app	 Applications.1^WideBoy:Applications:iCal.appiCal.appWideBoyApplications/iCal.app/oVW
Vl.-.-WX,
Xl+*+*,)YZ)Y(
(.aevtoappnull****Z'[&%\]$
'.aevtoappnull****
[k^^.__n##&%\"!"0i!0ii]8PBD IOX\`bU

	%HLPR  0myallnoteslistmyAllNotesList

appl

anot

dnot

iapp
.registernullnull

name

titl

desc
.notifygrnullnull
.misccurdldt null0now

wres0
everycalendar
everyCalendar

list0
currentevents
currentEvents

cobj

nmbr
0thiscalthisCal

wrev0
everyevent
everyEvent
0	thisevent	thisEvent

wr1s

wr5s0
eventtitle
eventTitle

wr11$0eventdescriptioneventDescription

wr12

reco0myrecordmyRecord0newlistnewList"0thiseventrecordthisEventRecord"0theeventsummarytheEventSummary*0theeventdescriptiontheEventDescription$/lvEO*UO*aaaUOa*jE`O*a-E`Ojva&E`Ok_a-a,Ekh_a/E`O_*a-E`Ok_a-a,Ekh_a/E` O_ \*a!,_O*a",_?a#_ a$,a%_ a&,a'a(&E`)O_)kva&E`*O__*%E`YhYhU[OYU[OYTO~k_a-a,Ekh_a/E`+O_+a#,E`,WX-.a/E`,O_+a%,E`0WX-.a1E`0O*a2_,a_0a3U[OYO_a-a,j#*a4a5aa6a7UOPYhOPUascrޭ


Added document name to _xml.applescript

Added document name to _xml.applescript

tell application "Skim"
	activate
	set xml to "<document name=" & quote & name of document 1 & quote & ">" & return
	set lastPage to count pages of document 1
	set firstPage to 1

	repeat with currentPage from firstPage to lastPage
		set pageNotes to notes of page currentPage of document 1

		set xml to xml & tab & "<page number=" & quote & currentPage & quote & ">" & return

		repeat with pageNote in pageNotes
			set xml to xml & tab & tab & "<note type=" & quote & (get type of pageNote) & quote & ">" & return
			set noteText to (get text of pageNote)
			set xml to xml & tab & tab & tab & "<text><![CDATA[" & noteText & "]]></text>" & return
			set noteBounds to get bounds for pageNote

			set pageHeight to get item 3 of (get bounds for (page currentPage of document 1))
			set x to item 1 of noteBounds
			set y to item 4 of noteBounds
			set width to (item 3 of noteBounds) - x
			set height to (item 2 of noteBounds) - y
			set y to pageHeight - y

			set xml to xml & tab & tab & tab & "<bounds " & "x=" & quote & x & quote & " y=" & quote & y & quote & " width=" & quote & width & quote & " height=" & quote & height & quote & "/>" & return

			set noteColor to get color of pageNote
			set cRed to item 1 of noteColor
			set cGreen to item 2 of noteColor
			set cBlue to item 3 of noteColor
			set cAlpha to item 4 of noteColor

			set xml to xml & tab & tab & tab & "<color " & "red=" & quote & cRed & quote & " green=" & quote & cGreen & quote & " blue=" & quote & cBlue & quote & " alpha=" & quote & cAlpha & quote & "/>" & return

			set xml to xml & tab & tab & "</note>" & return
		end repeat

		set xml to xml & tab & "</page>" & return

	end repeat

	set xml to xml & "</document>"
	return xml

end tell

tell application "Skim"
	activate
	set xml to "<document>" & return
	set lastPage to count pages of document 1
	set firstPage to 1

	repeat with currentPage from firstPage to lastPage
		set pageNotes to notes of page currentPage of document 1

		set xml to xml & tab & "<page number=" & quote & currentPage & quote & ">" & return

		repeat with pageNote in pageNotes
			set xml to xml & tab & tab & "<note type=" & quote & (get type of pageNote) & quote & ">" & return
			set noteText to (get text of pageNote)
			set xml to xml & tab & tab & tab & "<text><![CDATA[" & noteText & "]]></text>" & return
			set noteBounds to get bounds for pageNote

			set pageHeight to get item 3 of (get bounds for (page currentPage of document 1))
			set x to item 1 of noteBounds
			set y to item 4 of noteBounds
			set width to (item 3 of noteBounds) - x
			set height to (item 2 of noteBounds) - y
			set y to pageHeight - y

			set xml to xml & tab & tab & tab & "<bounds " & "x=" & quote & x & quote & " y=" & quote & y & quote & " width=" & quote & width & quote & " height=" & quote & height & quote & "/>" & return

			set noteColor to get color of pageNote
			set cRed to item 1 of noteColor
			set cGreen to item 2 of noteColor
			set cBlue to item 3 of noteColor
			set cAlpha to item 4 of noteColor

			set xml to xml & tab & tab & tab & "<color " & "red=" & quote & cRed & quote & " green=" & quote & cGreen & quote & " blue=" & quote & cBlue & quote & " alpha=" & quote & cAlpha & quote & "/>" & return

			set xml to xml & tab & tab & "</note>" & return
		end repeat

		set xml to xml & tab & "</page>" & return

	end repeat

	set xml to xml & "</document>"
	return xml

end tell


make the injector script more robust => repeat injection trials to overcome -609 errors

set lastErrMsg to "Unable to inject TotalFinder"
set lastErrCode to -1
set failed to yes
set nextDelay to 1

tell application "Finder"
	set startTime to current date

	-- under some conditions like system startup the system may be busy delivering apple events
	-- in this case we may get random "Connection is Invalid -609" AppleScript errors
	-- solution: we try it multiple times
	repeat
		-- increase the delay between individual trials
		log "delay " & (nextDelay as text) & "..."
		delay nextDelay
		set nextDelay to nextDelay + 1

		-- try injection
		try
			event BATFinit
			set failed to no
			exit repeat
		on error msg number code
			log "error: " & msg & "(" & (code as text) & ")"
			set lastErrMsg to msg
			set lastErrCode to code
		end try

		-- make sure we don't repeat this forever, two minutes should be enough
		if (current date) - startTime is greater than (2 * 60) then exit repeat

	end repeat

	if failed is yes then
		display dialog "
Unable to launch TotalFinder.

" & lastErrMsg & " (" & (lastErrCode as text) & ")" & "

Please email support@binaryage.com to get support on this issue." with icon 0 giving up after 30
	end if

end tell

tell application "Finder"
	delay 3 -- this delay is important to prevent random "Connection is Invalid -609" AppleScript errors
	try
		event BATFinit
	on error msg number num
		display dialog "
Unable to launch TotalFinder.

" & msg & " (" & (num as text) & ")" & "

You may visit
http://getsatisfaction.com/binaryage
to get support on this issue." with icon 0
	end try
end tell


Don’t set a label for our items in the mac installer

-- This Applescript sets up the installer disk image: size, background image,
--   icon view, background image, icon positioning.
-- Usage: osascript installer-dmg.applescript <volume-name>
-- where <volume-name> is the volume name of the disk image.

on run (volumeName)
	tell application "Finder"
		tell disk (volumeName as string)
			open

			set theXOrigin to 400
			set theYOrigin to 100
			set theWidth to 500
			set theHeight to 600
			set iconSize to 100

			set theBottomRightX to (theXOrigin + theWidth)
			set theBottomRightY to (theYOrigin + theHeight)
			set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""

			tell container window
				set current view to icon view
				set toolbar visible to false
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
				set statusbar visible to false

				set file_list to every file
				repeat with i in file_list
					if the name of i is "Applications" then
						set the position of i to {345, 125}
					else if the name of i ends with ".app" then
						set the position of i to {145, 125}
					else if the name of i is "LGPL License.txt" then
						set the position of i to {145, 225}
						set the extension hidden of i to true
					else if the name of i is "Vivox Acceptable Use Policy.txt" then
						set the position of i to {345, 225}
						set the extension hidden of i to true
					end if
				end repeat
			-- This close-open hack is nessesary to save positions on 10.6 Snow Leopard
			close
			open
			end tell

			set opts to the icon view options of container window
			tell opts
				set icon size to iconSize
				set arrangement to not arranged
			end tell

			set background picture of opts to file "background.png"

			update without registering applications
			-- Force saving of the size
			delay 1

			tell container window
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
			end tell

			update without registering applications
		end tell

		delay 1

		tell disk (volumeName as string)
			tell container window
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
			end tell

			update without registering applications
		end tell

		--give the finder some time to write the .DS_Store file
		delay 3

		set waitTime to 0
		set ejectMe to false
		repeat while ejectMe is false
			delay 1
			set waitTime to waitTime + 1

			if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
		end repeat
		log "waited " & waitTime & " seconds for .DS_STORE to be created."
	end tell
end run

-- This Applescript sets up the installer disk image: size, background image,
--   icon view, background image, icon positioning.
-- Usage: osascript installer-dmg.applescript <volume-name>
-- where <volume-name> is the volume name of the disk image.

on run (volumeName)
	tell application "Finder"
		tell disk (volumeName as string)
			open

			set theXOrigin to 400
			set theYOrigin to 100
			set theWidth to 500
			set theHeight to 600
			set iconSize to 100

			set theBottomRightX to (theXOrigin + theWidth)
			set theBottomRightY to (theYOrigin + theHeight)
			set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""

			tell container window
				set current view to icon view
				set toolbar visible to false
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
				set statusbar visible to false

				set file_list to every file
				repeat with i in file_list
					if the name of i is "Applications" then
						set the position of i to {345, 125}
					else if the name of i ends with ".app" then
						set the position of i to {145, 125}
					else if the name of i is "LGPL License.txt" then
						set the position of i to {145, 225}
						set the extension hidden of i to true
					else if the name of i is "Vivox Acceptable Use Policy.txt" then
						set the position of i to {345, 225}
						set the extension hidden of i to true
					end if
					-- Change the 7 to change the color: 0 is no label, then red,
					-- orange, yellow, green, blue, purple, or gray.
					set the label index of i to 7
				end repeat
			-- This close-open hack is nessesary to save positions on 10.6 Snow Leopard
			close
			open
			end tell

			set opts to the icon view options of container window
			tell opts
				set icon size to iconSize
				set arrangement to not arranged
			end tell

			set background picture of opts to file "background.png"

			update without registering applications
			-- Force saving of the size
			delay 1

			tell container window
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
			end tell

			update without registering applications
		end tell

		delay 1

		tell disk (volumeName as string)
			tell container window
				set statusbar visible to false
				set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
			end tell

			update without registering applications
		end tell

		--give the finder some time to write the .DS_Store file
		delay 3

		set waitTime to 0
		set ejectMe to false
		repeat while ejectMe is false
			delay 1
			set waitTime to waitTime + 1

			if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
		end repeat
		log "waited " & waitTime & " seconds for .DS_STORE to be created."
	end tell
end run


INTEGRATION: CWS aquabundle (1.2.30); FILE MERGED 2007/05/24 20:53:41 obr 1.2.30.1: #i73693# moved office directory structure up in the Mac OS X bundle and renamed program to MacOS

(*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: main.applescript,v $
 *
 *  $Revision: 1.4 $
 *
 *  last change: $Author: ihi $ $Date: 2007-06-05 11:52:25 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 *************************************************************************)

(*==== (global variables as get-functions) ====*)

on getOOInstallPath()
	return (((path to me) as string) & "Contents:")
end getOOInstallPath

on getOOResourcesPath()
	return (((path to me) as string) & "Contents:Resources:")
end getOOResourcesPath

on getOOProgramPath()
	return (getOOInstallPath() & "MacOS:")
end getOOProgramPath

on getScriptPath()
	-- set this to absolute path when debugging
	return (((path to me) as string) & "Contents:Resources:Scripts:")
end getScriptPath

on getOOUserSettingsPath()
	return (((path to home folder) as string) & "Library:Application Support:OpenOffice.org:%USERDIRPRODUCTVERSION:")
end getOOUserSettingsPath

on getOOUserFontPath()
	return (getOOUserSettingsPath() & "user:fonts:")
end getOOUserFontPath

on getUserLogsPath()
	return (((path to home folder) as string) & "Library:Logs:")
end getUserLogsPath

on shellTerminator()
	return (" &>/dev/null & echo $!") as string
end shellTerminator

--
-- the default handlers: run, open, idle, quit
--

on run
	if (preRun()) then
		logEvent("(Scripts/main) Running OpenOffice.org")
		openSoffice("-")
	end if
end run

on open (theFiles)
	if (preRun()) then
		openFiles(theFiles)
	end if
end open

on idle
	-- close icon only if ooo has terminated
	if (hasOOoQuit()) then
		tell me to quit
	end if
	-- check all x seconds if ok to quit
	return 3
end idle

on quit
	if (hasOOoQuit()) then
		continue quit
	end if
end quit

-------------------------------------------------------------

on preRun()

	-- Check for the required version of Mac OS X
	if (not atLeastOSXVersion(10, 3, 0)) then
		display dialog getMessage("ERROR_NEED_PANTHER")
		return false
	end if

	-- Check for that OOo can be found
	if (not isRealPath(getOOProgramPath())) then
		display dialog getMessage("ERROR_OOO_NOT_FOUND")
		return false
	end if

	if (not isRealPath(getOOUserFontPath())) then
		set createUserFont to "mkdir -p " & (quoted form of POSIX path of getOOUserFontPath()) & "; "
		do shell script createUserFont
	end if

	-- If no crash occured before, ~/Library/Logs does not exist, and OpenOffice.org cannot be started
	if (not isRealPath(getUserLogsPath())) then
		set createUserLogsPath to "mkdir -p " & (quoted form of POSIX path of getUserLogsPath()) & "; "
		do shell script createUserLogsPath
	end if

	-- Checks are ok, now do the PostInstall stuff (e.g. fondu)

	-- load helper library
	set postinstall to load script alias
		(getScriptPath() & "PostInstall.scpt")
	-- execute the postinstall script
	run of postinstall

	return true
end preRun

on hasOOoQuit()
	if (isRealPath(getOOProgramPath())) then
		-- set the location of soffice binary
		set soffice to (quoted form of (POSIX path of getOOProgramPath() & "soffice"))

		set isRunning to do shell script "_FOUND_=`ps -wx -o command | grep " & soffice & " | grep -v grep`; echo $_FOUND_"
		if isRunning  "" then
			return false
		else
			return true
		end if
	else
		return true
	end if
end hasOOoQuit

on openSoffice(aFile)
	set theDisplay to startXServer()
	if (theDisplay is equal to "error") then
		return
	end if
	set theEnv to "DISPLAY=" & theDisplay & " ; export DISPLAY; "
	set theCmd to "sh " & (quoted form of (POSIX path of getOOProgramPath() & "soffice")) & " "
	do shell script theEnv & theCmd & aFile & shellTerminator()
	-- logEvent("open CMD: " & theEnv & theCmd & aFile)
end openSoffice

-- helper function to start X11 server
on startXServer()

	-- get X settings
	set XSettingsList to findXServer()
	set whichserver to item 1 of XSettingsList
	set Xserverloc to item 2 of XSettingsList

	-- debug:
	-- logEvent("(scripts/main) X settings: " & whichserver & "--" & POSIX path of Xserverloc)
	-- set whichserver to "NOXSERVER"

	-- if nothing really was found, display an error message.
	if (whichserver is equal to "NOXSERVER") then

		display dialog getMessage("ERROR_NEED_X11") buttons {"Quit", "More Info"} default button "More Info"
		if the button returned of the result is "Quit" then
			quit
		else
			-- if more info is chosen, then open a help web page
			do shell script "open http://porting.openoffice.org/mac/faq/installing/X11.html"
			-- cannot continue, so quit the script
			return "error"
		end if

	end if

	set now_running to ""
	set now_running to do shell script "INX=`ps -wcx | grep  " & quoted form of (whichserver & "$") & "`; echo $INX"
	if whichserver = "NOXSERVER" then
		-- display dialog "No XServer Found"
		set now_running to "Skip"
	end if
	if now_running = "" then
		if whichserver = "X11" then
			set x11cmd to quoted form of (Xserverloc & "/Contents/MacOS/X11") & shellTerminator()
			do shell script x11cmd
			-- save process id
			set x11pid to the result
			-- wait until the window manager is started which is the second child process of x11
			set numchildrencmd to "ps -x -o ppid | grep " & x11pid & " | wc -l"
			set numchildren to 0
			set d to current date
			set t1 to time of d
			repeat while numchildren  2
				set d to current date
				set t2 to time of d
				-- give up after 30 seconds
				if t2 - t1 > 30 then
					display dialog "Command timed out"
					exit repeat
				end if
				set result to do shell script numchildrencmd
				set numchildren to result as integer
			end repeat
		else -- startup XDarwin
			do shell script "open " & quoted form of Xserverloc & shellTerminator()
			do shell script "sleep 4"
		end if
	end if
	if whichserver is equal to "X11" then
		-- the DISPLAY variable is different for every user currently logged in
		-- X11 passes the DISPLAY as the last command line parameter to its child process
		-- we can use ps to read the command line and parse the trailing :0, :1, or whatever
		set xdisplay to do shell script "ps -wx -o command | grep X11.app | grep \":.$\" | sed \"s/^.*:/:/g\""
		--display dialog xdisplay
		return xdisplay
	else
		-- TODO: find out how XDarwin does it
		return ":0"
	end if
end startXServer

on openFiles(fileList)
	if (count of fileList) > 0 then
		repeat with i from 1 to the count of fileList
			set theDocument to (item i of fileList)
			set theFilePath to (quoted form of POSIX path of theDocument)
			set theFileInfo to (info for theDocument)
			openSoffice(theFilePath)
			logEvent("(Scripts/main) Open file: " & theFilePath)
		end repeat
	end if
end openFiles

(* ===== (Helper functions) ======= *)

-- get a localized string
on getMessage(aKey)
	try
		if (aKey is equal to "YES_KEY") then
			return "Yes"
		end if

		if (aKey is equal to "NO_KEY") then
			return "No"
		end if

		if (aKey is equal to "ERROR_OOO_NOT_FOUND") then
			return "OpenOffice.org was not found on your system. Please (re-)install OpenOffice.org first."
		end if

		if (aKey is equal to "ERROR_NEED_PANTHER") then
			return "This build of OpenOffice.org cannot be run on this system, OpenOffice.org requires MacOSX 10.3 (Panther) or newer system"
		end if

		if (aKey is equal to "ERROR_NEED_X11") then
			return "OpenOffice.org for Mac OS X cannot be started, because the X11 software is not installed. Please install Apple X11 first from the Mac OS X install DVD. More information: http://porting.openoffice.org/mac/faq/installing/X11.html"
		end if
	end try
end getMessage

-- function for logging script messages
on logEvent(themessage)
	set theLine to (do shell script
		"date  +'%Y-%m-%d %H:%M:%S'" as string)
		& " " & themessage
	do shell script "echo " & quoted form of theLine &
		" >> ~/Library/Logs/OpenOffice%USERDIRPRODUCTVERSION.log"
end logEvent

-- function for checking if a path exists
on isRealPath(aPath)
	try
		alias aPath
		return true
	on error
		-- error number -43 from aPath
		-- display dialog "NotRP -- " & aPath
		return false
	end try
end isRealPath

-- try to find X11 server on the Mac OS X system
-- return value: the found server or "NOXSERVER"
on findXServer()
	-- First try standard X11 location, then try standard XDarwin location

	set whichserver to "NOXSERVER"
	--Utilities folder of system
	set Xserverloc to ((path to utilities folder from system domain) as string) & "X11.app:"
	--display dialog " Xserverloc" & Xserverloc
	if (isRealPath(Xserverloc)) then
		set whichserver to "X11"
		set Xserverloc to (POSIX path of Xserverloc)
	else
		--Applications folder of system
		set Xserverloc to ((path to applications folder from system domain) as string) & "XDarwin.app:"
		if (isRealPath(Xserverloc)) then
			set whichserver to "XDarwin"
			set Xserverloc to (POSIX path of Xserverloc)
		end if
	end if

	-- if nothing found yet try using locate, first with X11.app and then with XDarwin.app
	if (whichserver is equal to "NOXSERVER") then
		set Xserverloc to do shell script "locate X11.app/Contents/MacOS/X11 | sed -e 's-/Contents/MacOS/X11--g'"
		if Xserverloc  "" then
			set whichserver to "X11"
		end if
	end if

	if (whichserver is equal to "NOXSERVER") then
		set Xserverloc to do shell script "locate XDarwin.app/Contents/MacOS/XDarwin | sed -e 's-/Contents/MacOS/XDarwin--g'"
		if Xserverloc  "" then
			set whichserver to "XDarwin"
		end if
	end if

	return {whichserver, Xserverloc}
end findXServer

-- Test for a minimum version of Mac OS X
on atLeastOSXVersion(verMajor, verMinor, verStep)
	-- The StandardAdditions's 'system attribute' used to be the Finder's 'computer' command.
	tell application "Finder" to set sysv to (system attribute "sysv")

	-- Generate sysv-compatible number from given version
	set reqVer to ((verMajor div 10) * 4096 + (verMajor mod 10) * 256 + verMinor * 16 + verStep)

	-- DEBUGGING:
	-- display dialog ("RV:" & reqVer & " < " & sysv as string)

	-- set major to ((sysv div 4096) * 10 + (sysv mod 4096 div 256))
	-- set minor to (sysv mod 256 div 16)
	-- set step to (sysv mod 16)
	-- display dialog ("Your Mac OS X version: " & major & "." & minor & "." & step)

	if (reqVer > sysv) then
		return false
	else
		return true
	end if
end atLeastOSXVersion

(*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: main.applescript,v $
 *
 *  $Revision: 1.3 $
 *
 *  last change: $Author: kz $ $Date: 2007-05-10 09:15:16 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 *************************************************************************)

(*==== (global variables as get-functions) ====*)

on getOOInstallPath()
	-- return (((path to applications folder from system domain) as string) & "OpenOffice %PRODUCTVERSION.app:" & "Contents:MacOS:")
	return (((path to me) as string) & "Contents:MacOS:")
end getOOInstallPath

on getOOResourcesPath()
	return (((path to me) as string) & "Contents:Resources:")
end getOOResourcesPath

on getOOProgramPath()
	return (getOOInstallPath() & "program:")
end getOOProgramPath

on getScriptPath()
	-- set this to absolute path when debugging
	return (((path to me) as string) & "Contents:Resources:Scripts:")
end getScriptPath

on getOOUserSettingsPath()
	return (((path to home folder) as string) & "Library:Application Support:OpenOffice.org:%USERDIRPRODUCTVERSION:")
end getOOUserSettingsPath

on getOOUserFontPath()
	return (getOOUserSettingsPath() & "user:fonts:")
end getOOUserFontPath

on getUserLogsPath()
	return (((path to home folder) as string) & "Library:Logs:")
end getUserLogsPath

on shellTerminator()
	return (" &>/dev/null & echo $!") as string
end shellTerminator

--
-- the default handlers: run, open, idle, quit
--

on run
	if (preRun()) then
		logEvent("(Scripts/main) Running OpenOffice.org")
		openSoffice("-")
	end if
end run

on open (theFiles)
	if (preRun()) then
		openFiles(theFiles)
	end if
end open

on idle
	-- close icon only if ooo has terminated
	if (hasOOoQuit()) then
		tell me to quit
	end if
	-- check all x seconds if ok to quit
	return 3
end idle

on quit
	if (hasOOoQuit()) then
		continue quit
	end if
end quit

-------------------------------------------------------------

on preRun()

	-- Check for the required version of Mac OS X
	if (not atLeastOSXVersion(10, 3, 0)) then
		display dialog getMessage("ERROR_NEED_PANTHER")
		return false
	end if

	-- Check for that OOo can be found
	if (not isRealPath(getOOProgramPath())) then
		display dialog getMessage("ERROR_OOO_NOT_FOUND")
		return false
	end if

	if (not isRealPath(getOOUserFontPath())) then
		set createUserFont to "mkdir -p " & (quoted form of POSIX path of getOOUserFontPath()) & "; "
		do shell script createUserFont
	end if

	-- If no crash occured before, ~/Library/Logs does not exist, and OpenOffice.org cannot be started
	if (not isRealPath(getUserLogsPath())) then
		set createUserLogsPath to "mkdir -p " & (quoted form of POSIX path of getUserLogsPath()) & "; "
		do shell script createUserLogsPath
	end if

	-- Checks are ok, now do the PostInstall stuff (e.g. fondu)

	-- load helper library
	set postinstall to load script alias
		(getScriptPath() & "PostInstall.scpt")
	-- execute the postinstall script
	run of postinstall

	return true
end preRun

on hasOOoQuit()
	if (isRealPath(getOOProgramPath())) then
		-- set the location of soffice binary
		set soffice to (quoted form of (POSIX path of getOOProgramPath() & "soffice"))

		set isRunning to do shell script "_FOUND_=`ps -wx -o command | grep " & soffice & " | grep -v grep`; echo $_FOUND_"
		if isRunning  "" then
			return false
		else
			return true
		end if
	else
		return true
	end if
end hasOOoQuit

on openSoffice(aFile)
	set theDisplay to startXServer()
	if (theDisplay is equal to "error") then
		return
	end if
	set theEnv to "DISPLAY=" & theDisplay & " ; export DISPLAY; "
	set theCmd to "sh " & (quoted form of (POSIX path of getOOProgramPath() & "soffice")) & " "
	do shell script theEnv & theCmd & aFile & shellTerminator()
	-- logEvent("open CMD: " & theEnv & theCmd & aFile)
end openSoffice

-- helper function to start X11 server
on startXServer()

	-- get X settings
	set XSettingsList to findXServer()
	set whichserver to item 1 of XSettingsList
	set Xserverloc to item 2 of XSettingsList

	-- debug:
	-- logEvent("(scripts/main) X settings: " & whichserver & "--" & POSIX path of Xserverloc)
	-- set whichserver to "NOXSERVER"

	-- if nothing really was found, display an error message.
	if (whichserver is equal to "NOXSERVER") then

		display dialog getMessage("ERROR_NEED_X11") buttons {"Quit", "More Info"} default button "More Info"
		if the button returned of the result is "Quit" then
			quit
		else
			-- if more info is chosen, then open a help web page
			do shell script "open http://porting.openoffice.org/mac/faq/installing/X11.html"
			-- cannot continue, so quit the script
			return "error"
		end if

	end if

	set now_running to ""
	set now_running to do shell script "INX=`ps -wcx | grep  " & quoted form of (whichserver & "$") & "`; echo $INX"
	if whichserver = "NOXSERVER" then
		-- display dialog "No XServer Found"
		set now_running to "Skip"
	end if
	if now_running = "" then
		if whichserver = "X11" then
			set x11cmd to quoted form of (Xserverloc & "/Contents/MacOS/X11") & shellTerminator()
			do shell script x11cmd
			-- save process id
			set x11pid to the result
			-- wait until the window manager is started which is the second child process of x11
			set numchildrencmd to "ps -x -o ppid | grep " & x11pid & " | wc -l"
			set numchildren to 0
			set d to current date
			set t1 to time of d
			repeat while numchildren  2
				set d to current date
				set t2 to time of d
				-- give up after 30 seconds
				if t2 - t1 > 30 then
					display dialog "Command timed out"
					exit repeat
				end if
				set result to do shell script numchildrencmd
				set numchildren to result as integer
			end repeat
		else -- startup XDarwin
			do shell script "open " & quoted form of Xserverloc & shellTerminator()
			do shell script "sleep 4"
		end if
	end if
	if whichserver is equal to "X11" then
		-- the DISPLAY variable is different for every user currently logged in
		-- X11 passes the DISPLAY as the last command line parameter to its child process
		-- we can use ps to read the command line and parse the trailing :0, :1, or whatever
		set xdisplay to do shell script "ps -wx -o command | grep X11.app | grep \":.$\" | sed \"s/^.*:/:/g\""
		--display dialog xdisplay
		return xdisplay
	else
		-- TODO: find out how XDarwin does it
		return ":0"
	end if
end startXServer

on openFiles(fileList)
	if (count of fileList) > 0 then
		repeat with i from 1 to the count of fileList
			set theDocument to (item i of fileList)
			set theFilePath to (quoted form of POSIX path of theDocument)
			set theFileInfo to (info for theDocument)
			openSoffice(theFilePath)
			logEvent("(Scripts/main) Open file: " & theFilePath)
		end repeat
	end if
end openFiles

(* ===== (Helper functions) ======= *)

-- get a localized string
on getMessage(aKey)
	try
		if (aKey is equal to "YES_KEY") then
			return "Yes"
		end if

		if (aKey is equal to "NO_KEY") then
			return "No"
		end if

		if (aKey is equal to "ERROR_OOO_NOT_FOUND") then
			return "OpenOffice.org was not found on your system. Please (re-)install OpenOffice.org first."
		end if

		if (aKey is equal to "ERROR_NEED_PANTHER") then
			return "This build of OpenOffice.org cannot be run on this system, OpenOffice.org requires MacOSX 10.3 (Panther) or newer system"
		end if

		if (aKey is equal to "ERROR_NEED_X11") then
			return "OpenOffice.org for Mac OS X cannot be started, because the X11 software is not installed. Please install Apple X11 first from the Mac OS X install DVD. More information: http://porting.openoffice.org/mac/faq/installing/X11.html"
		end if
	end try
end getMessage

-- function for logging script messages
on logEvent(themessage)
	set theLine to (do shell script
		"date  +'%Y-%m-%d %H:%M:%S'" as string)
		& " " & themessage
	do shell script "echo " & quoted form of theLine &
		" >> ~/Library/Logs/OpenOffice%USERDIRPRODUCTVERSION.log"
end logEvent

-- function for checking if a path exists
on isRealPath(aPath)
	try
		alias aPath
		return true
	on error
		-- error number -43 from aPath
		-- display dialog "NotRP -- " & aPath
		return false
	end try
end isRealPath

-- try to find X11 server on the Mac OS X system
-- return value: the found server or "NOXSERVER"
on findXServer()
	-- First try standard X11 location, then try standard XDarwin location

	set whichserver to "NOXSERVER"
	--Utilities folder of system
	set Xserverloc to ((path to utilities folder from system domain) as string) & "X11.app:"
	--display dialog " Xserverloc" & Xserverloc
	if (isRealPath(Xserverloc)) then
		set whichserver to "X11"
		set Xserverloc to (POSIX path of Xserverloc)
	else
		--Applications folder of system
		set Xserverloc to ((path to applications folder from system domain) as string) & "XDarwin.app:"
		if (isRealPath(Xserverloc)) then
			set whichserver to "XDarwin"
			set Xserverloc to (POSIX path of Xserverloc)
		end if
	end if

	-- if nothing found yet try using locate, first with X11.app and then with XDarwin.app
	if (whichserver is equal to "NOXSERVER") then
		set Xserverloc to do shell script "locate X11.app/Contents/MacOS/X11 | sed -e 's-/Contents/MacOS/X11--g'"
		if Xserverloc  "" then
			set whichserver to "X11"
		end if
	end if

	if (whichserver is equal to "NOXSERVER") then
		set Xserverloc to do shell script "locate XDarwin.app/Contents/MacOS/XDarwin | sed -e 's-/Contents/MacOS/XDarwin--g'"
		if Xserverloc  "" then
			set whichserver to "XDarwin"
		end if
	end if

	return {whichserver, Xserverloc}
end findXServer

-- Test for a minimum version of Mac OS X
on atLeastOSXVersion(verMajor, verMinor, verStep)
	-- The StandardAdditions's 'system attribute' used to be the Finder's 'computer' command.
	tell application "Finder" to set sysv to (system attribute "sysv")

	-- Generate sysv-compatible number from given version
	set reqVer to ((verMajor div 10) * 4096 + (verMajor mod 10) * 256 + verMinor * 16 + verStep)

	-- DEBUGGING:
	-- display dialog ("RV:" & reqVer & " < " & sysv as string)

	-- set major to ((sysv div 4096) * 10 + (sysv mod 4096 div 256))
	-- set minor to (sysv mod 256 div 16)
	-- set step to (sysv mod 16)
	-- display dialog ("Your Mac OS X version: " & major & "." & minor & "." & step)

	if (reqVer > sysv) then
		return false
	else
		return true
	end if
end atLeastOSXVersion


initial commit

initial commit

Clipboard - Replace String in FileMaker Objects.applescript


Clean up devtools mac script logic

Clean up devtools mac script logic


minor formatting

minor formatting

Scripts/fmClip - Custom Function Paste As Needed.applescript


Update openQnA.scpt

Update openQnA.scpt

-- http://www-01.ibm.com/support/docview.wss?uid=swg21506026
-- https://github.com/jgstew/tools/blob/master/bash/openQnA.sh
-- http://alvinalexander.com/blog/post/mac-os-x/applescript-use-comments
tell application "Terminal"
	if not (exists window 1) then reopen
	activate
	do script "/Library/BESAgent/BESAgent.app/Contents/MacOS/QnA -showtypes" in window 1
end tell

-- http://stackoverflow.com/questions/5288161/converting-to-one-line-applescript
-- osascript -e 'tell application "Terminal"' -e 'if not (exists window 1) then reopen' -e 'activate' -e 'do script "/Library/BESAgent/BESAgent.app/Contents/MacOS/QnA -showtypes" in window 1' -e 'end tell'


increase delay before injection from 1s to 3s this could help some slower systems during system startup

tell application "Finder"
	delay 3 -- this delay is important to prevent random "Connection is Invalid -609" AppleScript errors
	try
		event BATFinit
	on error msg number num
		display dialog "
Unable to launch TotalFinder.

" & msg & " (" & (num as text) & ")" & "

You may visit
http://getsatisfaction.com/binaryage
to get support on this issue." with icon 0
	end try
end tell

tell application "Finder"
	delay 1 -- this delay is important to prevent random "Connection is Invalid -609" AppleScript errors
	try
		event BATFinit
	on error msg number num
		display dialog "
Unable to launch TotalFinder.

" & msg & " (" & (num as text) & ")" & "

You may visit
http://getsatisfaction.com/binaryage
to get support on this issue." with icon 0
	end try
end tell


updated inspector close handler

updated inspector close handler

-- fmGUI_Inspector_Close()
-- Daniel A. Shockley, NYHTC
-- Closes FileMaker's Inspector window

(*
HISTORY:
	1.2 - 2016-09-16 ( eshagdar ): wait until the window no longer exists.
	1.1 - 2016-08-29 ( eshagdar ): return a result. added documentation.
	1.0 - 201x-xx-xx ( dshockley ): first created

REQUIRES:
	fmGUI_AppFrontMost
*)

property helper : ""

on run
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of ((path to me) as string)
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of pathHelper
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of pathHelper
	set pathHelper to POSIX file (pathHelper & "/main.scpt") as string
	set helper to load script file pathHelper

	fmGUI_Inspector_Close()
end run

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

on fmGUI_Inspector_Close()
	-- version 1.2

	fmGUI_AppFrontMost()
	tell application "System Events"
		tell application process "FileMaker Pro Advanced"
			-- try the click twice in case the first only brings window to front.
			try
				set index of (first window whose name is "Inspector") to 1
			end try
			try
				click button 1 of (first window whose name is "Inspector")
			end try

			--wait until the window no longer exists ( or we time out )
			repeat 20 times
				try
					get first window whose name is "Inspector"
				on error
					exit repeat
				end try
				delay 0.5
			end repeat

			return true
		end tell
	end tell
end fmGUI_Inspector_Close

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

on fmGUI_AppFrontMost()
	tell helper to fmGUI_AppFrontMost()
end fmGUI_AppFrontMost

-- fmGUI_Inspector_Close()
-- Daniel A. Shockley, NYHTC
-- Closes FileMaker's Inspector window

(*
HISTORY:
	1.1 - 2016-08-29 ( eshagdar ): return a result. added documentation.
	1.0 - 201x-xx-xx ( dshockley ): first created

REQUIRES:
	fmGUI_AppFrontMost
*)

property helper : ""

on run
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of ((path to me) as string)
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of pathHelper
	set pathHelper to do shell script "dirname " & quoted form of POSIX path of pathHelper
	set pathHelper to POSIX file (pathHelper & "/main.scpt") as string
	set helper to load script file pathHelper

	fmGUI_Inspector_Close()
end run

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

on fmGUI_Inspector_Close()
	-- version 1.1

	fmGUI_AppFrontMost()
	tell application "System Events"
		tell application process "FileMaker Pro Advanced"
			-- try the click twice in case the first only brings window to front.
			try
				set index of (first window whose name is "Inspector") to 1
			end try
			try
				click button 1 of (first window whose name is "Inspector")
			end try
			try
				click button 1 of (first window whose name is "Inspector")
			end try
			return true
		end tell
	end tell
end fmGUI_Inspector_Close

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

on fmGUI_AppFrontMost()
	tell helper to fmGUI_AppFrontMost()
end fmGUI_AppFrontMost


Run mac script

Run mac script

FasdUAS 1.101.10
k
lIC ==================================================================		 ==================================================================

l
	 PROGRESS
 PROGRESS
lIC ================================================================== ==================================================================
l
l
r
mDaily Sync
1

ppgd
l
r !
 m
!1

ppgt"#
"j$0
progresssteps
progressSteps
$m#%&
%i'(
'I) 0updateprogressupdateProgress)*
*1

dscr
(k#++,-
,I.
.sysodelanullnmbr
.m-/0
/r12
11

dscr
21

ppga034
3r56
5[78
7o0
progresssteps
progressSteps
8m
6o0
progresssteps
progressSteps49
9r#:;
:o0
progresssteps
progressSteps
;1"

ppgc&<=
<l=>?
>l?@A
@lBCBIC ==================================================================CDD ==================================================================AEF
ElGHG STARTHII STARTFJK
JlLMLIC ==================================================================MNN ==================================================================KOP
OlPQR
QlS
SIT 0updateprogressupdateProgressTU
Um
VVWW6Starting apps and processesRXY
XlYZ[
Zi
\]
\I^0gettodayappsgetTodayApps^_`
_o0core`ab
ao	0otherbcd
co0workde
eo0
background
]k.ffgh
gr	ij
inkl
km

wkdy
llm
mI
.misccurdldt null
jo	0todayhn
nZ
.opqr
ol

s
s=

tu
to
	0today
um

sun
pLv
vbwx
wo0core
xo0
backgroundqyz
yl{
{=|}
|o	0today
}m

sat z~
~L#
b"
b
o0core
o	0other
o !0
background
rL&.
b&-
b&+
b&)
o&'0core
o'(	0other
o)*0work
o+,0
background[
l
l Open native apps" Open native apps
l
r
J
mTodoist
mCalendar
mMessages
mMail
o0core
l$
r$
J"
mPhotos
mAnki
mSpotify
m
Slack
o	0other
l%+
r%+
J%'
o0work
l,F
r,F
J,B
m,/Google Drive
m/2(Google Photos Backup
m25Flux
m58
Slate
m8;Seil
m;>Karabiner
o0
background
lGX
rGX
IGT0gettodayappsgetTodayApps
oHI0core
oIJ	0other
oJM0work
oMP0
background
o0
nativeapps
nativeApps
lY~
XY~
Ioy
.aevtoappnull****
4ou

capp
ost0	nativeapp	nativeApp0	nativeapp	nativeApp
o\_0
nativeapps
nativeApps
l
l Open web apps Open web apps
l
r
J
m>http://www.apple.com/ios/health
m0https://myfitnesspal.com
o~~0core
l}|
r

	J

mHhttps://www.rescuetime.com/dashboard

m<https://wakatime.com/dashboard
m(https://www.mint.com
m,https://www.egghead.io
m0https://www.codewars.com !
 m""##$https://buffer.com!$%
$m&&''Thttps://www.youtube.com/feed/subscriptions%()
(m**++(https://facebook.com),{
,m--..&https://twitter.com{

ozz	0other}|/0
/l1yx
1r23
2J4456
5m7788@https://domo.demo.domo.com/inbox69:
9m;;<<6https://domo.domo.com/inbox:=>
=m??@@https://domo.okta.com/home/jira_onprem/0oa1moe1d0joaWP4P0x7/3549>AB
AmCCDDhttps://git.empdev.domo.com/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22mobile-web%22BEw
EmFFGGfhttps://app.getsentry.com/domo-mobile-web/mobilewebw
3ovv0workyx0HI
HlJut
JrKL
KJss
Lorr0
backgroundutIMN
MlOqp
OrPQ
PIoRno0gettodayappsgetTodayAppsRST
Somm0coreTUV
Uoll	0otherVWX
Wokk0workXYj
Yoii0
backgroundjn
Qohh0webappswebAppsqpNZ[
Zl\gf
\X]e^
]Id_c
d.sysoexecTEXTTEXT
_b`a
`mbbcc
open
aobb0webappwebAppce0webappwebApp
^oaa0webappswebAppsgf[de
dl`_^`_^efg
fl]\[]\[ghi
hlZjkZjIC ==================================================================kll ==================================================================imn
mlYopYo
 CONFIGUREpqq CONFIGUREnrs
rlXtuXtIC ==================================================================uvv ==================================================================swx
wlWVUWVUxyz
yl
{TS
{I
R|QR 0updateprogressupdateProgress|}P
}m~~(Configuring settingsPQTSz
lONMONM
lLL Turn off WiFi Turn off WiFi
lKJ
IIH
I.sysoexecTEXTTEXT
mJnetworksetup -setairportpower en0 offHKJ
lGFEGFE
lDD Run window manager& Run window manager
lCB
IA@
A.sysodelanullnmbr
m??@CB>
l5=<
O5
I4;
;.prcskcodnull****
m"::98
9
faal
J%0
m%(7
7eMdsKcmd
m(+6
6eMdsKopt5
m+.4
4eMdsKctl58
msevsalisMacintosh HD{H+ZKSystem Events.app]u	 CoreServices
ZKZJZI=Macintosh HD:System:Library:CoreServices:System Events.app$System Events.appMacintosh HD-System/Library/CoreServices/System Events.app/=<>3210/.-,3+*)('&%$#"! +0
progresssteps
progressSteps* 0updateprogressupdateProgress)0gettodayappsgetTodayApps
(.aevtoappnull****'0core&	0other%0work$0
background#0
nativeapps
nativeApps"0webappswebApps! 2( 0updateprogressupdateProgress

dscr

dscr
.sysodelanullnmbr

ppga

ppgc$kjO*,FObkEcOb*,F]0gettodayappsgetTodayApps

	0core	0other
0work	0
background0core	0other0work0
background	0today
.misccurdldt null

wkdy

sun

sat /*j,EO	%Y%%Y
%%%
.aevtoappnull****
k5Q/HMZy0	nativeapp	nativeApp0webappwebApp?V"&*-7;?CFb~

ppgd

ppgt 0updateprogressupdateProgress0core	0other0work0
background0gettodayappsgetTodayApps0
nativeapps
nativeApps

kocl

cobj
.corecnte********

capp
.aevtoappnull****	0webappswebApps
.sysoexecTEXTTEXT
.sysodelanullnmbr

faal
eMdsKcmd
eMdsKopt
eMdsKctl
.prcskcodnull****6*,FOl*,FO*k+OvEOvEOjvE`OaaaaaaavE`O*__+E`O$_[aalkh*a/j[OYOa a!lvEOa"a#a$a%a&a'a(a)a*a+vEOa,a-a.a/a0a1vE`OjvE`O*__+E`2O#_2[aalkha3%j4[OYO*a5k+Oa6j4Okj7Oa8a9a:a;a<a=mvl>U		"&*-7;?CF"&*-10/.-,ascrޭ

FasdUAS 1.101.10
k
lIC ==================================================================		 ==================================================================

l
	 PROGRESS
 PROGRESS
lIC ================================================================== ==================================================================
l
l
r
mDaily Sync
1

ppgd
l
r !
 m
!1

ppgt"#
"j$0
progresssteps
progressSteps
$m#%&
%i'(
'I) 0updateprogressupdateProgress)*
*1

dscr
(k#++,-
,I.
.sysodelanullnmbr
.m-/0
/r12
11

dscr
21

ppga034
3r56
5[78
7o0
progresssteps
progressSteps
8m
6o0
progresssteps
progressSteps49
9r#:;
:o0
progresssteps
progressSteps
;1"

ppgc&<=
<l=>?
>l?@A
@lBCBIC ==================================================================CDD ==================================================================AEF
ElGHG STARTHII STARTFJK
JlLMLIC ==================================================================MNN ==================================================================KOP
OlPQR
QlS
SIT 0updateprogressupdateProgressTU
Um
VVWW6Starting apps and processesRXY
XlYZ[
Zi
\]
\I^0gettodayappsgetTodayApps^_`
_o0core`ab
ao	0otherbcd
co0workde
eo0
background
]k.ffgh
gr	ij
inkl
km

wkdy
llm
mI
.misccurdldt null
jo	0todayhn
nZ
.opqr
ol

s
s=

tu
to
	0today
um

sun
pLv
vbwx
wo0core
xo0
backgroundqyz
yl{
{=|}
|o	0today
}m

sat z~
~L#
b"
b
o0core
o	0other
o !0
background
rL&.
b&-
b&+
b&)
o&'0core
o'(	0other
o)*0work
o+,0
background[
l
l Open native apps" Open native apps
l
r
J
mTodoist
mCalendar
mMessages
mMail
o0core
l$
r$
J"
mPhotos
mAnki
mSpotify
m
Slack
o	0other
l%+
r%+
J%'
o0work
l,F
r,F
J,B
m,/Google Drive
m/2(Google Photos Backup
m25Flux
m58
Slate
m8;Seil
m;>Karabiner
o0
background
lGX
rGX
IGT0gettodayappsgetTodayApps
oHI0core
oIJ	0other
oJM0work
oMP0
background
o0
nativeapps
nativeApps
lY~
XY~
Ioy
.aevtoappnull****
4ou

capp
ost0	nativeapp	nativeApp0	nativeapp	nativeApp
o\_0
nativeapps
nativeApps
l
l Open web apps Open web apps
l
r
J
m>http://www.apple.com/ios/health
m0https://myfitnesspal.com
o~~0core
l}|
r

	J

mHhttps://www.rescuetime.com/dashboard

m<https://wakatime.com/dashboard
m(https://www.mint.com
m,https://www.egghead.io
m0https://www.codewars.com !
 m""##$https://buffer.com!$%
$m&&''Thttps://www.youtube.com/feed/subscriptions%()
(m**++(https://facebook.com),{
,m--..&https://twitter.com{

ozz	0other}|/0
/l1yx
1r23
2J4456
5m7788@https://domo.demo.domo.com/inbox69:
9m;;<<6https://domo.domo.com/inbox:=>
=m??@@https://domo.okta.com/home/jira_onprem/0oa1moe1d0joaWP4P0x7/3549>AB
AmCCDDhttps://git.empdev.domo.com/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22mobile-web%22BEw
EmFFGGfhttps://app.getsentry.com/domo-mobile-web/mobilewebw
3ovv0workyx0HI
HlJut
JrKL
KJss
Lorr0
backgroundutIMN
MlOqp
OrPQ
PIoRno0gettodayappsgetTodayAppsRST
Somm0coreTUV
Uoll	0otherVWX
Wokk0workXYj
Yoii0
backgroundjn
Qohh0webappswebAppsqpNZ[
Zl\gf
\X]e^
]Id_c
d.sysoexecTEXTTEXT
_b`a
`mbbcc
open
aobb0webappwebAppce0webappwebApp
^oaa0webappswebAppsgf[de
dl`_^`_^efg
fl]\[]\[ghi
hlZjkZjIC ==================================================================kll ==================================================================imn
mlYopYo
 CONFIGUREpqq CONFIGUREnrs
rlXtuXtIC ==================================================================uvv ==================================================================swx
wlWVUWVUxyz
yl
{TS
{I
R|QR 0updateprogressupdateProgress|}P
}m~~(Configuring settingsPQTSz
lONMONM
lLL Turn off WiFi Turn off WiFi
lKJ
IIH
I.sysoexecTEXTTEXT
mJnetworksetup -setairportpower en0 offHKJ
lGFEGFE
lDD Run window manager& Run window manager
lCB
IA@
A.sysodelanullnmbr
m??@CB>
l5=<
O5
I4;
;.prcskcodnull****
m"::98
9
faal
J%0
m%(7
7eMdsKcmd
m(+6
6eMdsKopt5
m+.4
4eMdsKctl58
msevsalisMacintosh HD{H+ZKSystem Events.app]u	 CoreServices
ZKZJZI=Macintosh HD:System:Library:CoreServices:System Events.app$System Events.appMacintosh HD-System/Library/CoreServices/System Events.app/=<>3210/.-,3+*)('&%$#"! +0
progresssteps
progressSteps* 0updateprogressupdateProgress)0gettodayappsgetTodayApps
(.aevtoappnull****'0core&	0other%0work$0
background#0
nativeapps
nativeApps"0webappswebApps! 2( 0updateprogressupdateProgress

dscr

dscr
.sysodelanullnmbr

ppga

ppgc$kjO*,FObkEcOb*,F]0gettodayappsgetTodayApps

	0core	0other
0work	0
background0core	0other0work0
background	0today
.misccurdldt null

wkdy

sun

sat /*j,EO	%Y%%Y
%%%
.aevtoappnull****
k5Q/HMZy0	nativeapp	nativeApp0webappwebApp?V"&*-7;?CFb~

ppgd

ppgt 0updateprogressupdateProgress0core	0other0work0
background0gettodayappsgetTodayApps0
nativeapps
nativeApps

kocl

cobj
.corecnte********

capp
.aevtoappnull****	0webappswebApps
.sysoexecTEXTTEXT
.sysodelanullnmbr

faal
eMdsKcmd
eMdsKopt
eMdsKctl
.prcskcodnull****6*,FOl*,FO*k+OvEOvEOjvE`OaaaaaaavE`O*__+E`O$_[aalkh*a/j[OYOa a!lvEOa"a#a$a%a&a'a(a)a*a+vEOa,a-a.a/a0a1vE`OjvE`O*__+E`2O#_2[aalkha3%j4[OYO*a5k+Oa6j4Okj7Oa8a9a:a;a<a=mvl>U		"&*-7;?CF"&*-7;?CF10/.-,ascrޭ


add ability to test uris

add ability to test uris

FasdUAS 1.101.10
k
l
r
m

niji://
	o0uri

l"
V"
k

I

.sysodlogaskrTEXT
m
<Enter a "niji://" URI to test.

dtxt
o
0uri
r
n
1

ttxt
1

rslt
o0uri
I
.GURLGURLnullTEXT
 o0uri
m
boovtrue
!"
!l"#
#i$%
$I&
.GURLGURLnullTEXT
&o0uri
%k''()
(l*+* Decode URI+,, Decode URI)-.
-Q*/01
/r23
2n45
4767

ctxt
6l8
8[9:
9l	;
;I	<
.sysooffslongnull<=>

psof
=m??@@://>A

psin
Ao
0uri
:m
7m
5o0uri
3o0resource
0R
.ascrerr ********
1k"*BBCD
CI"'E
.sysonotfnullTEXT
Em"#FFGG*Malformed URI: Empty.DH
HL(*.IJ
Ir+6KL
KI+4M
.sysooffslongnullMNO

psof
Nm-.PPQQ?OR

psin
Ro/00resource
Lo0qJST
SZ7IUV
UA7:WX
Wo780q
Xm89
Vk=EYYZ[
ZI=B\
.sysonotfnullTEXT
\m=>]]^^2Malformed URI: No action.[_
_LCET`a
`rJYbc
bnJWde
d7KWfg

ctxt
fmOQ
glRVh
h\RVij
ioST0q
jmTU
eoJK0resource
co
0actionakl
kQZwmno
mr]lpq
pn]jrs
r7^jtu

ctxt
tlbfv
v[bfwx
wocd0q
xmde
umgi
so]^0resource
qo
0params
nR
.ascrerr ********
ortwyz
ymtu{{||
zo
0paramsl}~
}rx}
mxy&
n
1z|

txdl
1yz

ascr~
r~
n~
2

citm
o~
0params
o0keyvals
r
m=
n
1

txdl
1

ascr
r
J
o0opts
Y
k
r
n
4

cobj
o0i
o0keyvals
o0kv
Q
s
n
2

citm
o0kv
J
o0k
o0v
R
.ascrerr ********
I
.sysonotfnullTEXT
b
b
m4Malformed URI parameter. (
o0kv
m)
r
I
.sysoexecTEXTTEXT
b
b
m0php -r 'echo urldecode("
o0v
m");'
o0decoded
r
b
o0opts
l
I
.sysodsct****scpt
b
b
b
b
m{|
o0k
m|:"
o0decoded
m"}
o0opts0i
m
I
.corecnte********
o0keyvals
r

m

n
1

txdl
1

ascr
l~}~}
l|| Select action Select action{
Z
=
ozz
0action
m
apply
k
lyy  Check for required params4 Check for required params
QL
k4
r$
n"
o"xx0cmd
oww0opts
ovv0_cmd
r%,

	n%*
o&*uu0name
o%&tt0opts

oss	0_name
r

r-4
n-2
o.2qq0yaml
o-.pp0opts
ooo	0_yamlr
Rnm
n.ascrerr ********
oll0msgm
k<L
I<Ikj
k.sysonotfnullTEXT
b<E
b<A
m<?>Missing a required parameter. (
o?@ii0msg
mAD)jh
LJLggh !
 lMMfedfed!"#
"lMMc$%c$# Write yaml to temporary file%&&: Write yaml to temporary file#'(
'QM)*+
)kP,,-.
-rPe/0
/bPa12
1lP]3ba
3IP]`45
`.earsffdralis afdr
4mPS_
_afdrtemp5^6]
^
rtyp
6mVY\
\
TEXT]ba
2m]`7788niji.yaml
0o[[0tmp.9Z
9IfY:X
Y.sysoexecTEXTTEXT
:bf{;<
;bfs=>
=bfo?@
?mfiAABB
echo
@linCWV
CninDE
D1jnU
U
strq
EoijTT	0_yamlWV
>morFFGG >
<nszHI
H1vzS
S
psxp
IosvRR0tmpXZ
*RQJP
Q.ascrerr ********
JoOO0msgP
+kKKLM
LINNM
N.sysonotfnullTEXT
NbOP
ObQR
QmSSTTRFailed to write YAML to temporary file. (
RoLL0msg
PmUUVV)MMWK
WLJJK(XY
XlIHGIHGYZ[
ZlF\]F\
 Run zenbu]^^ Run zenbu[_E
_Q`ab
`kccde
dIDfC
D.sysoexecTEXTTEXT
fbgh
gbij
ibkl
kbmn
mmooppbash -lc "
noBB0_cmd
lmqqrr
jnst
s1A
A
psxp
to@@0tmp
hmuuvv"Cew?
wI>x=
>.sysonotfnullTEXT
xbyz
yb{|
{m}}~~Applied "
|o<<	0_name
zm".=?
aR;:
;.ascrerr ********
o990msg:
bk
I87
8.sysonotfnullTEXT
b
b
b
b
mFailed run `
o660_cmd
m`. (
o550msg
m)74
L334E
=
o22
0action
msave1
kz
l00  Check for required params4 Check for required params
Q
k
r
n
o//0root
o..0opts
o--	0_root
r
n
o,,0name
o++0opts
o**	0_name)
r
n
o((0yaml
o''0opts
o&&	0_yaml)
R%$
%.ascrerr ********
o##0msg$
k
I"!
".sysonotfnullTEXT
b
b
m>Missing a required parameter. (
o  0msg
m)!
L
l
l
l    Write yaml to destination4 Write yaml to destination
r 1
b -
b )
b '
o #	0_root
m#&/
o'(	0_name
m),
.yaml
o0dest
Q2z
k5Z
I5J
.sysoexecTEXTTEXT
b5F
b5B
b5>
m58
echo
l8=
n8=
19=

strq
o89

	0_yaml
m>A >
oBE0dest
IKZ

.sysonotfnullTEXT
bKV
bKR
mKNSaved to "
oNQ0dest
mRU".
R
.ascrerr ********
o0msg
kbz
Ibw
.sysonotfnullTEXT
bbs
bbo
bbm
bbi
mbe

2Failed to write YAML to "
	oeh0dest
mil

" file. (
omn0msg
mor)
Lxz1
I}
.sysonotfnullTEXT
b}
b}
m}Action "
o
0action
m&" is not supported.{
.GURLGURLnullTEXT
.aevtoappnull****0uri%
.GURLGURLnullTEXT0uri0uri0resource0q
0action
0params0keyvals0opts0i0kv0k0v0decoded0_cmd	0_name	0_yaml0msg0tmp	0_root0destG?FP]{7AFSUoqu}

ctxt

psof

psin
.sysooffslongnull
.sysonotfnullTEXT

ascr

txdl

citm
.corecnte********

cobj
.sysoexecTEXTTEXT
.sysodsct****scpt0cmd0name0yaml0msg
afdrtemp

rtyp

TEXT
.earsffdralis afdr

strq

psxp0root[\[Z*m\Zi2EWXj	OhO*EOl
j	OhYhO[\[Zk\Zk2EO[\[Zk\Zi2EW
XEO,FOa-EOa,FOjvEOukjkha/EOa-E[ak/EQZ[al/EQZWXa%a%j	Oa%a%jEOa%a%%a%j%E[OYOa,FOaa,EOa ,EOa!,EWX"a#%a$%j	OhO4a%a&a'l(a)%E^Oa*a+,%a,%]a-,%jWX"a.%a/%j	OhO,a0%a1%]a-,%a2%jOa3%a4%j	WX"a5%a6%%a7%j	OhYa8a9,E^Oa ,EOa!,EWX"a:%a;%j	OhO]a<%%a=%E^O*a>a+,%a?%]%jOa@]%aA%j	WX"aB]%aC%%aD%j	OhYaE%aF%j	 !"
.aevtoappnull****
 k"##$$!"
0uri

dtxt
.sysodlogaskrTEXT

rslt

ttxt
.GURLGURLnullTEXT#EOhelO,EOj[OY%%6niji://apply?cmd=hi&name=hoascr
ޭ

FasdUAS 1.101.10
k
l
I
.sysodisAaleRTEXT
m

ZThis app registers the "niji://" URI handler.
l

i
I
.GURLGURLnullTEXT
o0uri
k
l Decode URI Decode URI
Q'
r
n
7 !

ctxt
 l"
"[#$
#l	%
%I	&
.sysooffslongnull&'(

psof
'm))**://(+

psin
+o
0uri
$m
!m
o0uri
o0resource
R
.ascrerr ********
I"',
.sysonotfnullTEXT
,m"#--..*Malformed URI: Empty./0
/r(312
1I(13
.sysooffslongnull345

psof
4m*+6677?58

psin
8o,-0resource
2o0q09:
9Z4F;<
;A47=>
=o450q
>m56
<k:B??@A
@I:?B
.sysonotfnullTEXT
Bm:;CCDD2Malformed URI: No action.AE
EL@B:FG
FrGVHI
HnGTJK
J7HTLM

ctxt
LmLN
MlOSN
N\OSOP
OoPQ0q
PmQR
KoGH0resource
Io
0actionGQR
QQWtSTU
SrZiVW
VnZgXY
X7[gZ[

ctxt
Zl_c\
\[_c]^
]o`a0q
^mab
[mdf
YoZ[0resource
Wo
0params
TR
.ascrerr ********
Urqt_`
_mqraabb
`o
0paramsRcd
cruzef
emuvgghh&
fnij
i1wy

txdl
j1vw

ascrdkl
kr{mn
mn{op
o2|

citm
po{|
0params
no0keyvalslqr
qrst
smuuvv=
tnwx
w1

txdl
x1

ascrryz
yr{|
{J
|o0optsz}~
}Y
k
r
n
4

cobj
o0i
o0keyvals
o0kv
Q
s
n
2

citm
o0kv
J
o0k
o0v
R
.ascrerr ********
I
.sysonotfnullTEXT
b
b
m4Malformed URI parameter. (
o0kv
m)
r
I
.sysoexecTEXTTEXT
b
b
m0php -r 'echo urldecode("
o0v
m");'
o0decoded
r
b
o0opts
l
I
.sysodsct****scpt
b
b
b
b
m{|
o0k
m|:"
o0decoded
m"}
o0opts0i
m
I
.corecnte********
o0keyvals~
r
m

n
1

txdl
1

ascr
l
l Select action Select action
Z
=
o
0action
m
apply
k
l  Check for required params4 Check for required params
QI
k1
r!
n
o0cmd
o0opts
o0_cmd
r")
n"'
o#'0name
o"#0opts
o	0_name
r*1
n*/
o+/0yaml
o*+0opts
o~~	0_yaml
R}|
}.ascrerr ********
o{{0msg|
k9I
I9Fzy
z.sysonotfnullTEXT
b9B
b9>
m9<>Missing a required parameter. (
o<=xx0msg
m>A)yw
LGIvvw
lJJutsuts
lJJr
r
# Write yaml to temporary file: Write yaml to temporary file

QJ
kM|
rMb
bM^
lMZqp
IMZo
o.earsffdralis afdr
mMPn
nafdrtempml
m
rtyp
mSVk
k
TEXTlqp
mZ]niji.yaml
ojj0tmpi
Ic|h g
h.sysoexecTEXTTEXT
 bcx!"
!bcp#$
#bcl%&
%mcf''((
echo
&lfk)fe
)nfk*+
*1gkd
d
strq
+ofgcc	0_yamlfe
$mlo,,-- >
"npw./
.1swb
b
psxp
/opsaa0tmpgi
R`0_
`.ascrerr ********
0o^^0msg_
k1123
2I]4\
].sysonotfnullTEXT
4b56
5b78
7m99::RFailed to write YAML to temporary file. (
8o[[0msg
6m;;<<)\3=Z
=LYYZ>?
>lXWVXWV?@A
@lUBCUB
 Run zenbuCDD Run zenbuAET
EQFGH
FkIIJK
JISLR
S.sysoexecTEXTTEXT
LbMN
MbOP
ObQR
QbST
SmUUVVbash -lc "
ToQQ0_cmd
RmWWXX
PnYZ
Y1P
P
psxp
ZoOO0tmp
Nm[[\\"RK]N
]IM^L
M.sysonotfnullTEXT
^b_`
_bab
amccddApplied "
boKK	0_name
`meeff".LN
GRJgI
J.ascrerr ********
goHH0msgI
Hkhhij
iIGkF
G.sysonotfnullTEXT
kblm
lbno
nbpq
pbrs
rmttuuFailed run `
soEE0_cmd
qmvvww`. (
ooDD0msg
mmxxyy)FjzC
zLBBCT{|
{=}~
}oAA
0action
~msave|@
kw
l??  Check for required params4 Check for required params
Q
k
r
n
o>>0root
o==0opts
o<<	0_root
r
n
o;;0name
o::0opts
o99	0_name8
r
n
o770yaml
o660opts
o55	0_yaml8
R43
4.ascrerr ********
o220msg3
k
I10
1.sysonotfnullTEXT
b
b
m>Missing a required parameter. (
o//0msg
m)0.
L--.
l,+*,+*
l)(')('
l&&  Write yaml to destination4 Write yaml to destination
r.
b*
b&
b$
o %%	0_root
m #/
o$%$$	0_name
m&)
.yaml
o##0dest"
Q/w
k2W
I2G!
!.sysoexecTEXTTEXT
b2C
b2?
b2;
m25
echo
l5:
n5:
16:

strq
o56	0_yaml
m;> >
o?B0dest
IHW
.sysonotfnullTEXT
bHS
bHO
mHKSaved to "
oKN0dest
mOR".
R
.ascrerr ********
o0msg
k_w
I_t
.sysonotfnullTEXT
b_p
b_l
b_j
b_f
m_b2Failed to write YAML to "
obe0dest
mfi" file. (
ojk0msg
mlo)
Luw"@
Iz

.sysonotfnullTEXT
bz
bz
mz}Action "
o}~
0action
m&" is not supported.

	.GURLGURLnullTEXT
.aevtoappnull****
.GURLGURLnullTEXT0uri0uri0resource0q
0action
0params0keyvals0opts0i0kv0k0v0decoded0_cmd	0_name	0_yaml0msg0tmp	0_root0destG)-6Cagu',9;UW[cetvx

ctxt

psof

psin
.sysooffslongnull
.sysonotfnullTEXT

ascr

txdl

citm
.corecnte********

cobj
.sysoexecTEXTTEXT
.sysodsct****scpt0cmd0name0yaml0msg
afdrtemp

rtyp

TEXT
.earsffdralis afdr

strq

psxp0root[\[Z*m\Zi2EWXj	O*EOl
j	OhYhO[\[Zk\Zk2EO[\[Zk\Zi2EW
XEO,FOa-EOa,FOjvEOukjkha/EOa-E[ak/EQZ[al/EQZWXa%a%j	Oa%a%jEOa%a%%a%j%E[OYOa,FOaa,EOa ,EOa!,EWX"a#%a$%j	OhO4a%a&a'l(a)%E^Oa*a+,%a,%]a-,%jWX"a.%a/%j	OhO,a0%a1%]a-,%a2%jOa3%a4%j	WX"a5%a6%%a7%j	OhYa8a9,E^Oa ,EOa!,EWX"a:%a;%j	OhO]a<%%a=%E^O*a>a+,%a?%]%jOa@]%aA%j	WX"aB]%aC%%aD%j	OhYaE%aF%j
.aevtoappnull****
k
.sysodisAaleRTEXTjascr
ޭ