text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set thePopup to missing value
|
lns3.scpt
|
display dialog theValue
|
lns3.scpt
|
on createCheckBoxMainThread:theArg
|
lns3.scpt
|
set {theTitle, theAction} to theArg as list
|
lns3.scpt
|
set my theCheckbox to current application's NSButton's alloc()'s initWithFrame:{{10, 10}, {150, 18}}
|
lns3.scpt
|
its setButtonType:(current application's NSSwitchButton)
|
lns3.scpt
|
its setTitle:theTitle
|
lns3.scpt
|
its setTarget:me
|
lns3.scpt
|
its setAction:theAction -- a handler in this script
|
lns3.scpt
|
end createCheckBoxMainThread:
|
lns3.scpt
|
set {entryList, defaultValue} to theArg as list
|
lns3.scpt
|
set my thePopup to current application's NSPopUpButton's alloc()'s initWithFrame:{{10, 35}, {150, 26}} pullsDown:false
|
lns3.scpt
|
on buildAccessoryViewMainThread:theControls
|
lns3.scpt
|
set my theAccessoryView to current application's NSView's alloc()'s initWithFrame:{{0, 0}, {160, 60}}
|
lns3.scpt
|
repeat with aControl in theControls
|
lns3.scpt
|
(theAccessoryView's addSubview:aControl)
|
lns3.scpt
|
end buildAccessoryViewMainThread:
|
lns3.scpt
|
on checkboxClicked:sender
|
lns3.scpt
|
set theWindow to sender's |window|()
|
lns3.scpt
|
set theAlert to current application's NSAlert's alloc()'s init()
|
lns3.scpt
|
theAlert's setMessageText:"You clicked the checkbox"
|
lns3.scpt
|
theAlert's setInformativeText:"Now close this sheet"
|
lns3.scpt
|
theAlert's beginSheetModalForWindow:theWindow completionHandler:(missing value)
|
lns3.scpt
|
end checkboxClicked:
|
lns3.scpt
|
my buildAccViewWithCheckbox()
|
lns3.scpt
|
my performSelectorOnMainThread:"buildAccViewWithCheckbox" withObject:(missing value) waitUntilDone:true
|
lns3.scpt
|
display dialog theState as text
|
lns3.scpt
|
on buildAccViewWithCheckbox()
|
lns3.scpt
|
its setTitle:"This is a checkbox"
|
lns3.scpt
|
its setAction:"checkboxClicked:" -- a handler in this script
|
lns3.scpt
|
set my theAccessoryView to current application's NSView's alloc()'s initWithFrame:{{0, 0}, {160, 28}}
|
lns3.scpt
|
theAccessoryView's addSubview:theCheckbox
|
lns3.scpt
|
end buildAccViewWithCheckbox
|
lns3.scpt
|
set theFolder to choose folder with prompt "Choose a folder"
|
lns3.scpt
|
set theNames to displayed name of files of theFolder
|
lns3.scpt
|
set theModDates to modification date of files of theFolder
|
lns3.scpt
|
set theCreationDates to creation date of files of theFolder
|
lns3.scpt
|
set theSizes to size of files of theFolder
|
lns3.scpt
|
set theKinds to kind of files of theFolder
|
lns3.scpt
|
set theLocks to locked of files of theFolder
|
lns3.scpt
|
set theFiles to files of theFolder as alias list
|
lns3.scpt
|
set theData to «event !©M1!©cR» {theNames, theModDates, theCreationDates, theSizes, theKinds, theLocks, theFiles}
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» theData with «class mlsl» given «class !©Ch»:{"Name", "Date Modified", "Date Created", "Size", "Kind", "Locked"}, «class prmp»:"Choose your files"
|
lns3.scpt
|
«event !©Mt!©Tm» myTable with «class !©Ab»
|
lns3.scpt
|
«event !©Mt!©Mc» myTable given «class !©Df»:"d MMM yyyy, H:mm"
|
lns3.scpt
|
«event !©Mt!©Mc» myTable given «class !©Cl»:{4, 6}, «class !©Ha»:«constant !©Am!©Ac»
|
lns3.scpt
|
set theResult to «event !©Mt!©Sd» myTable
|
lns3.scpt
|
set theNames to «event !©M1!©cE» 7 given «class !©S1»:«class !©Zv» of theResult
|
lns3.scpt
|
«event !©Mt!©dT» {{"One", true, 1, "One"}, {"Two", false, 2, "Two"}, {"Three", true, 3, "Three"}, {"Four", false, 4, "Four"}, {"Five", true, 5, "Five"}} with «class !©Rn» given «class !©Ec»:{1, 2, 3}, «class !©Ch»:{"Number", "", "Digit", "Match"}, «class !©Rt»:{"", true, 1, {«class !©Pm», {"One", "Two", "Three"}}}, «class appr»:"Sample table", «class prmp»:"This table has a column with popup menus"
|
lns3.scpt
|
«event !©Mt!©dT» {{"One", true, 1, "One"}, {"Two", false, 2, "Two"}, {"Three", true, 3, "Three"}, {"Four", false, 4, "Four"}, {"Five", true, 5, "Five"}} with «class !©Rn» given «class !©Ec»:{1, 2, 3}, «class !©Ch»:{"Number", "", "Digit", "Match"}, «class !©Rt»:{"", true, 1, {«class comB», {"One", "Two", "Three"}}}, «class appr»:"Sample table", «class prmp»:"This table has a column with combo boxes"
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» {{"One", true, 1, "One"}, {"Two", false, 2, "Two"}, {"Three", true, 3, "Three"}, {"Four", false, 4, "Four"}, {"Five", true, 5, "Five"}} with «class !©Rn» given «class !©Ec»:{1, 2, 3}, «class !©Ch»:{"Number", "", "Digit", "Match"}, «class !©Rt»:{text, boolean, integer, {«class comB», {"One", "Two", "Three"}}}, «class appr»:"Sample table", «class prmp»:"This table has centered entries, and returns an extended table reply"
|
lns3.scpt
|
«event !©Mt!©Mc» myTable given «class !©Ea»:«constant !©Am!©Ac»
|
lns3.scpt
|
«event !©Mt!©Sd» myTable with «class !©Sx»
|
lns3.scpt
|
set theHeads to {"First Name", "Last Name", "Index", "Police", "Score", "Some Date"}
|
lns3.scpt
|
set someData to {{"Saga", "Norén", 1, true, 12.0, theDate}, ¬
|
lns3.scpt
|
{"Rasmus", "Larsson", 2, true, 13.5, missing value}, ¬
|
lns3.scpt
|
{"Freddie", "Holst", 3, false, 9.0, theDate + 40000}, ¬
|
lns3.scpt
|
{"Claes", "Sandberg", 4, false, 1.23456789E+4, theDate + 50000}, ¬
|
lns3.scpt
|
{"John", "Lundqvist", 5, true, 13.4567, theDate + 30000}, ¬
|
lns3.scpt
|
{"Annika", "Melander", 6, false, 22.0, theDate + 60000}}
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» someData with «class mlsl», «class !©Rn» and «class empL» given «class appr»:"Sample table", «class !©Ch»:theHeads, «class prmp»:"You can select multiple rows. Everything is editable. Uses a row template", «class !©Ec»:{}, «class !©Rt»:{"", "", 1, true, 1.0, current date, missing value}
|
lns3.scpt
|
«event !©Mt!©Tm» myTable given «class !©Hr»:{2, 4}, «class !©Gs»:«constant !©GS!©g+», «class okbt»:"Cool"
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» someData with «class mlsl», «class !©Ad», «class !©Rn» and «class empL» given «class appr»:"Sample table", «class !©Ch»:theHeads, «class prmp»:"In this table you can drop files, add and delete rows, and drag rows to reorder them. Note the extra button", «class !©Is»:{2}, «class !©Ec»:{}
|
lns3.scpt
|
«event !©Mt!©Tm» myTable with «class !©Rd» given «class !©Eb»:"Hmmm…"
|
lns3.scpt
|
«event !©Mt!©Mc» myTable given «class !©Df»:"MMMM d, yyyy", «class !©Ea»:«constant !©Am!©Ac»
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» someData with «class mlsl», «class !©Ad», «class !©Rn» and «class empL» given «class appr»:"Sample table", «class !©Ch»:theHeads, «class prmp»:"In this table the date formatting is based on the user's settings in System Preferences.", «class !©Is»:{2}, «class !©Ec»:{}
|
lns3.scpt
|
«event !©Mt!©Mc» myTable given «class !©Du»:{«constant !©Ud!©Uf», «constant !©Ud!©Uf»}, «class !©Ea»:«constant !©Am!©Ac»
|
lns3.scpt
|
set theHeads to {"First Name", "Last Name", "Password", "Index"}
|
lns3.scpt
|
set someData to {{"Saga", "Norén", "password", 1}, ¬
|
lns3.scpt
|
{"Rasmus", "Larsson", "", 2}, ¬
|
lns3.scpt
|
{"Freddie", "Holst", "", 3}, ¬
|
lns3.scpt
|
{"Claes", "Sandberg", "", 4}, ¬
|
lns3.scpt
|
{"John", "Lundqvist", "", 5}, ¬
|
lns3.scpt
|
{"Annika", "Melander", "", 6}}
|
lns3.scpt
|
set myTable to «event !©Mt!©Td» someData with «class mlsl», «class !©Rn» and «class empL» given «class appr»:"Sample table", «class !©Ch»:theHeads, «class prmp»:"You can select multiple rows. Everything is editable. Uses a row template. The Password field’s values are hidden.", «class !©Ec»:{}, «class !©Rt»:{"", "", "hidden", 1}
|
lns3.scpt
|
«event !©Mt!©Tm» myTable given «class !©Gs»:«constant !©GS!©g+»
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, "One" & return & "two", 1.1}, {2.1, "Two", 2.2}, {3.0, "Three" & linefeed & "four" & linefeed & "five", 3.3}, {4.0, "Four", 4.4}, {5.0, "Five", 5.5}} with «class !©El» given «class !©Ch»:{"Reals", "Text", "Reals"}, «class !©Ec»:{2}, «class prmp»:"Note the multiple-line entries"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable given «class !©Ha»:«constant !©Am!©Ac», «class !©Rf»:"#,##0.000;-#,##0.000"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable given «class !©Cl»:{2}, «class !©Ea»:«constant !©Am!©Ac»
|
lns3.scpt
|
«event !©Mt!©Tm» theTable with «class !©Cb» and «class !©Ab»
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"Note the appearance of negative values"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable with «class !©Re» given «class !©Cl»:{}
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"Note the bold first column"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable with «class !©Bt» given «class !©Cl»:{1}
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"Note the monospaced digits if you are running macOS 10.11 or a later version"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable with «class !©Mo» given «class !©Cl»:{}
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1, "One"}, {-2.0, 2, 2.2, 2, "Three" & linefeed & "four" & linefeed & "five"}, {3.11, -3, 3.11, 3, "Two"}, {4.0, 4, -4.41, 4, "Seven"}, {5.0, 5, 5.55, -5, "Three" & linefeed & "four" & linefeed & "five"}} with «class !©El» given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers", "Text"}, «class prmp»:"This table combines the new features in version 1.0.6"
|
lns3.scpt
|
«event !©Mt!©Mc» theTable with «class !©Mo» and «class !©Re» given «class !©Cl»:{1, 2, 3, 4}
|
lns3.scpt
|
«event !©Mt!©Mc» theTable with «class !©Bt» given «class !©Cl»:{2}
|
lns3.scpt
|
«event !©Mt!©dT» {"One", "Two", "Three", "Four", "Five"} with «class !©Ok» and «class empL» given «class appr»:"Simple table", «class prmp»:"You can double-click an entry rather than selecting and pressing OK"
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} with «class !©Ok» and «class empL» given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"This table appears at the top-left of the screen"
|
lns3.scpt
|
«event !©Mt!©Tm» theTable with «class !©Ab» given «class !©Ip»:{0, 0}
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} with «class !©Ok» and «class empL» given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"This table's size and position have been set in the script"
|
lns3.scpt
|
«event !©Mt!©Tm» theTable with «class !©Ab» given «class !©Ip»:{100, 10, 400, 400}
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} with «class !©Ok» and «class empL» given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"Move and resize this dialog before clicking OK"
|
lns3.scpt
|
«event !©Mt!©Tm» theTable with «class !©Ab»
|
lns3.scpt
|
set theResult to «event !©Mt!©Sd» theTable
|
lns3.scpt
|
set theBounds to «class !©Fp» of theResult
|
lns3.scpt
|
set theTable to «event !©Mt!©Td» {{1.0, 1, 1.11, 1}, {-2.0, 2, 2.2, 2}, {3.11, -3, 3.11, 3}, {4.0, 4, -4.41, 4}, {5.0, 5, 5.55, -5}} with «class !©Ok» and «class empL» given «class !©Ch»:{"Reals", "Integers", "Reals", "Integers"}, «class prmp»:"This table's size and position should match those used last time"
|
lns3.scpt
|
«event !©Mt!©Tm» theTable with «class !©Ab» given «class !©Ip»:theBounds
|
lns3.scpt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.