text
stringlengths
0
15.7k
source
stringlengths
6
112
set thisWidth to width of |size| of theFrame
lns3.scpt
set buttonHeight to height of |size| of theFrame
lns3.scpt
set thisWidth to item 1 of item 2 of theFrame
lns3.scpt
set buttonHeight to item 2 of item 2 of theFrame
lns3.scpt
if not equalWidths and thisWidth < minimumButtonWidth then
lns3.scpt
set thisWidth to minimumButtonWidth
lns3.scpt
(thisButton's setFrameSize:{thisWidth, buttonHeight})
lns3.scpt
set minAccViewWidth to minAccViewWidth + thisWidth
lns3.scpt
if thisWidth > minButtonWidth then set minButtonWidth to thisWidth
lns3.scpt
if equalWidths then
lns3.scpt
repeat with aButton in allButtons
lns3.scpt
(aButton's setFrameSize:{minButtonWidth, buttonHeight})
lns3.scpt
set minAccViewWidth to buttonCount * minButtonWidth
lns3.scpt
set my handlerResult to {allButtons, minAccViewWidth}
lns3.scpt
end createButtonsViewMainThread:
lns3.scpt
on closeTheWindow:theButton
lns3.scpt
(NSApp)'s stopModalWithCode:(theButton's tag())
lns3.scpt
end closeTheWindow:
lns3.scpt
on control:theControl textView:theTextView doCommandBySelector:theSel
lns3.scpt
if theSel = "insertNewline:" then
lns3.scpt
theTextView's insertNewlineIgnoringFieldEditor:me
lns3.scpt
else if theSel = "insertTab:" then
lns3.scpt
theTextView's insertTabIgnoringFieldEditor:me
lns3.scpt
end control:textView:doCommandBySelector:
lns3.scpt
use script "Dialog Toolkit Plus" version "1.1.0"
lns3.scpt
set theLabelStrings to {"This job is for:", "Operator's name:"}
lns3.scpt
set maxLabelWidth to «event !ASuMlWd» theLabelStrings
lns3.scpt
set {theCheckbox, theTop, newWidth} to «event !ASuCrCb» "One side only" without «class !IsT» given «class !Lli»:controlLeft, «class !BtM»:0, «class !MxW»:400
lns3.scpt
set {colorPopup, popupLabel, theTop} to «event !ASuCrPl» {"Red", "Green", "Blue"} given «class !Lli»:0, «class !BtM»:(theTop + 8), «class !PuW»:100, «class !MxW»:400, «class !LtX»:(item 1 of theLabelStrings), «class !PuL»:controlLeft
lns3.scpt
set {operatorField, operatorLabel, theTop, fieldLeft} to «event !ASuCrLs» (short user name of (system info)) given «class !FpL»:"Your name", «class !Lli»:0, «class !BtM»:(theTop + 8), «class !StW»:400, «class !LtX»:(item 2 of theLabelStrings), «class !FlF»:controlLeft
lns3.scpt
set allControls to {theCheckbox, colorPopup, popupLabel, operatorField, operatorLabel}
lns3.scpt
set {buttonName, suppressedState, controlResults} to «event !AScDiEa» "Send for output" without «class !suP» given «class mesS»:"More text goes in here", «class as A»:«constant !AtP*nfA», «class btns»:{"Cancel", "Maybe", "Perhaps", "OK"}, «class givu»:120, «class !AvW»:400, «class !AvH»:theTop, «class !AvC»:allControls
lns3.scpt
set {sideChoiceBoolean, chosenColor, unused, operatorName, unused} to controlResults
lns3.scpt
set {instructionsField, instructionsLabel, theTop} to «event !ASuCrLf» "" with «class !MlT» given «class !FpL»:"Extra instructions go here", «class !Lli»:0, «class !BtM»:0, «class !FwI»:400, «class !ExH»:60, «class !LtX»:"Instructions"
lns3.scpt
set {operatorField, operatorLabel, theTop, fieldLeft} to «event !ASuCrLs» (short user name of (system info)) given «class !FpL»:"Your name", «class !Lli»:0, «class !BtM»:(theTop + 8), «class !StW»:400, «class !LtX»:"Operator:", «class !FlF»:0
lns3.scpt
set {theRule, theTop} to «event !ASuCrRu» (theTop + 12) given «class !Lli»:0, «class !RwI»:400
lns3.scpt
set {thePathControl, pathLabel, theTop} to «event !ASuCrP+» (POSIX path of (path to documents folder)) with «class !PoP» given «class !Lli»:0, «class !BtM»:(theTop + 12), «class !CwI»:400, «class !LtX»:"Choose or drag the file here:"
lns3.scpt
set {theCheckbox, theTop, newWidth} to «event !ASuCrCb» "One side only" without «class !IsT» given «class !Lli»:0, «class !BtM»:(theTop + 8), «class !MxW»:400
lns3.scpt
set {colorPopup, popupLabel, theTop} to «event !ASuCrPl» {"Red", "Green", "Blue"} given «class !Lli»:0, «class !BtM»:(theTop + 8), «class !PuW»:100, «class !MxW»:400, «class !LtX»:"Job is for:", «class !PuL»:150, «class !MuD»:"Green"
lns3.scpt
set {jobMatrix, matrixLabel, theTop, matrixLeft} to «event !ASuCrLm» {"Press 1", "Press 2", "Press 3"} without «class !VeR» given «class !Lli»:0, «class !BtM»:(theTop + 8), «class !MxW»:400, «class !MxL»:0, «class !LtX»:"Job is for:", «class !MuD»:3
lns3.scpt
set allControls to {instructionsField, instructionsLabel, operatorField, operatorLabel, theRule, thePathControl, pathLabel, theCheckbox, colorPopup, popupLabel, jobMatrix, matrixLabel}
lns3.scpt
set {buttonName, suppressedState, controlsResults} to «event !AScDiEa» "Send for output" without «class !suP» given «class mesS»:"", «class as A»:«constant !AtP*riT», «class btns»:{"Cancel", "OK"}, «class givu»:120, «class !AvW»:400, «class !AvH»:theTop, «class !AvC»:allControls
lns3.scpt
set theMessage to "How many buttons would you like? There's no real limit except for practical and aesthetic considerations." & return & "Of course, I hope you'll never really think about using something as ugly as this!" & return & return & "Choose your heart out!"
lns3.scpt
set {theField, theTop} to «event !ASuCrTf» "" with «class !MlT» given «class !FpL»:"Enter your text here", «class !Lli»:0, «class !BtM»:0, «class !FwI»:650, «class !ExH»:60
lns3.scpt
set {buttonName, suppressedState, controlsResults} to «event !AScDiEa» "Many Buttons" without «class !suP» given «class mesS»:theMessage, «class as A»:«constant !AtP*nfA», «class btns»:{"OK", "Five", "Four", "Three", "Two", "One", "Cancel"}, «class givu»:0, «class !AvW»:650, «class !AvH»:theTop, «class !AvC»:{theField}
lns3.scpt
set accViewWidth to 400
lns3.scpt
set {theButtons, minWidth} to «event !ASc!CbS» {"Cancel", "Maybe", "It All Depends", "OK"} with «class !beQ» given «class dflt»:"OK", «class cbtn»:"Cancel"
lns3.scpt
if minWidth > accViewWidth then set accViewWidth to minWidth -- make sure buttons fit
lns3.scpt
set {theCheckbox, theTop, newWidth} to «event !ASuCrCb» "One side only" without «class !IsT» given «class !Lli»:controlLeft, «class !BtM»:0, «class !MxW»:accViewWidth
lns3.scpt
set {colorPopup, popupLabel, theTop} to «event !ASuCrPl» {"Red", "Green", "Blue"} given «class !Lli»:0, «class !BtM»:(theTop + 8), «class !PuW»:100, «class !MxW»:accViewWidth, «class !LtX»:(item 1 of theLabelStrings), «class !PuL»:controlLeft, «class !MuD»:"Green"
lns3.scpt
set {operatorField, operatorLabel, theTop, fieldLeft} to «event !ASuCrLs» (short user name of (system info)) given «class !FpL»:"Your name", «class !Lli»:0, «class !BtM»:(theTop + 12), «class !StW»:accViewWidth, «class !LtX»:(item 2 of theLabelStrings), «class !FlF»:controlLeft
lns3.scpt
set {messageLabel, theTop} to «event !ASuCrLa» "More text goes in here" given «class !BtM»:theTop + 12, «class !MxW»:accViewWidth, «class !MuS»:«constant !CsZ!CsC»
lns3.scpt
set {boldLabel, theTop} to «event !ASuCrLa» "Send for output" with «class !MuB» given «class !BtM»:theTop + 8, «class !MxW»:accViewWidth, «class !MuS»:«constant !CsZ!CrL»
lns3.scpt
set allControls to {theCheckbox, colorPopup, popupLabel, operatorField, operatorLabel, boldLabel, messageLabel}
lns3.scpt
set {buttonName, controlsResults} to «event !AScDiEw» "Many Buttons" with «class !AvL» given «class !AvW»:accViewWidth, «class !AvH»:theTop, «class !AvC»:allControls, «class btns»:theButtons, «class !AiP»:{100, 30}, «class givu»:10
lns3.scpt
set {sideChoiceBoolean, chosenColor, unused, operatorName, unused, unused, unused} to controlsResults
lns3.scpt
set {theButtons, minWidth} to «event !ASc!CbS» {"Cancel", "OK"} given «class dflt»:1, «class btns»:2
lns3.scpt
set {instructionsField, instructionsLabel, theTop} to «event !ASuCrLf» "" with «class !MlT» given «class !FpL»:"Extra instructions go here", «class !BtM»:0, «class !FwI»:accViewWidth, «class !ExH»:60, «class !LtX»:"Instructions"
lns3.scpt
set {operatorField, operatorLabel, theTop, fieldLeft} to «event !ASuCrLs» (short user name of (system info)) given «class !FpL»:"Your name", «class !BtM»:(theTop + 8), «class !StW»:accViewWidth, «class !LtX»:"Operator:", «class !FlF»:0
lns3.scpt
set {theRule, theTop} to «event !ASuCrRu» (theTop + 12) given «class !RwI»:accViewWidth
lns3.scpt
set {thePathControl, pathLabel, theTop} to «event !ASuCrP+» (POSIX path of (path to documents folder)) given «class !BtM»:(theTop + 12), «class !CwI»:accViewWidth, «class !LtX»:"Choose or drag the file here:"
lns3.scpt
set {theCheckbox, unusedTop, newWidth} to «event !ASuCrCb» "One side only" given «class !BtM»:(theTop + 8), «class !MxW»:accViewWidth / 2 - 8
lns3.scpt
set {secondCheckbox, theTop, newWidth} to «event !ASuCrCb» "Mirror image" with «class !IsT» given «class !BtM»:(theTop + 8), «class !MxW»:accViewWidth / 2 - 8, «class !Lli»:accViewWidth / 2 + 8
lns3.scpt
set {colorPopup, popupLabel, theTop} to «event !ASuCrPl» {"Red", "Green", "Blue"} given «class !BtM»:(theTop + 8), «class !PuW»:100, «class !MxW»:accViewWidth, «class !LtX»:"Job is for:", «class !PuL»:70, «class !MuD»:2
lns3.scpt
set {jobMatrix, matrixLabel, theTop, matrixLeft} to «event !ASuCrLm» {"Press 1", "Press 2", "Press 3"} given «class !BtM»:(theTop + 8), «class !MxW»:accViewWidth, «class !MxL»:70, «class !LtX»:"Job is for:", «class !MuD»:"Press 2" --without arranged vertically
lns3.scpt
set {boldLabel, theTop} to «event !ASuCrLa» "This is a large, bold, ugly label and it runs across the top of the dialog, centered and wrapping lines if necessary" with «class !MuB» given «class !BtM»:theTop + 20, «class !MxW»:accViewWidth, «class !MuS»:«constant !CsZ!CrC», «class !AlI»:«constant !LaL!LcE»
lns3.scpt
set allControls to {instructionsField, instructionsLabel, operatorField, operatorLabel, theRule, thePathControl, pathLabel, theCheckbox, secondCheckbox, colorPopup, popupLabel, jobMatrix, matrixLabel, boldLabel}
lns3.scpt
set {buttonName, controlsResults} to «event !AScDiEw» "Complex sample" with «class !AvL» given «class !AvW»:accViewWidth, «class !AvH»:theTop, «class !AvC»:allControls, «class btns»:theButtons, «class !AcF»:instructionsField
lns3.scpt
set accViewWidth to 350
lns3.scpt
set {theButtons, minWidth} to «event !ASc!CbS» {"Cancel", "OK"} given «class dflt»:2, «class cbtn»:1
lns3.scpt
if minWidth > accViewWidth then set accViewWidth to minWidth -- make uttons fit
lns3.scpt
set {secureField, theTop} to «event !ASuCrSf» "" given «class !FpL»:"Enter your password", «class !BtM»:10, «class !FwI»:accViewWidth
lns3.scpt
set {secureLabel, theTop} to «event !ASuCrLa» "This is an example of a secure field:" given «class !BtM»:theTop + 20, «class !MxW»:accViewWidth, «class !MuS»:«constant !CsZ!CrL»
lns3.scpt
set {buttonName, controlsResults} to «event !AScDiEw» "Secure field" without «class !AvL» given «class !AvW»:accViewWidth, «class !AvH»:theTop, «class !AvC»:{secureField, secureLabel}, «class btns»:theButtons, «class !AcF»:secureField, «class !AiP»:{0, 0}
lns3.scpt
set accViewWidth to 650
lns3.scpt
set {theButtons, minWidth} to «event !ASc!CbS» {"Cancel", "Five", "Four", "Three", "Two", "One", "OK"} given «class !btK»:{"", "5", "4", "3", "2", "1", ""}, «class dflt»:7, «class cbtn»:1
lns3.scpt
set {theField, theTop} to «event !ASuCrTf» "" with «class !MlT» given «class !FpL»:"Enter your text here", «class !BtM»:0, «class !FwI»:accViewWidth, «class !ExH»:60
lns3.scpt
set {boldLabel, theTop} to «event !ASuCrLa» "How many buttons would you like? There's no real limit except for practical and aesthetic considerations." & return & "Of course, I hope you'll never really think about using something as ugly as this!" & return & return & "Choose your heart out!" & return & return & "Also, try the command-1 thru command-5 button shortcuts." given «class !BtM»:theTop + 20, «class !MxW»:accViewWidth, «class !MuS»:«constant !CsZ!CrL»
lns3.scpt
set {buttonName, controlsResults} to «event !AScDiEw» "Many Buttons" with «class !AvL» given «class !AvW»:accViewWidth, «class !AvH»:theTop, «class !AvC»:{theField, boldLabel}, «class btns»:theButtons, «class !AcF»:theField, «class !AiP»:{0, 0}
lns3.scpt
property NSURLVolumeURLKey : a reference to current application's NSURLVolumeURLKey
lns3.scpt
property NSURLContentAccessDateKey : a reference to current application's NSURLContentAccessDateKey
lns3.scpt
property NSURLCreationDateKey : a reference to current application's NSURLCreationDateKey
lns3.scpt
property NSURLAddedToDirectoryDateKey : a reference to current application's NSURLAddedToDirectoryDateKey
lns3.scpt
property NSURLNameKey : a reference to current application's NSURLNameKey
lns3.scpt
property NSSortDescriptor : a reference to current application's NSSortDescriptor
lns3.scpt
property NSURLContentModificationDateKey : a reference to current application's NSURLContentModificationDateKey
lns3.scpt
property NSMutableArray : a reference to current application's NSMutableArray
lns3.scpt
property NSURLIsDirectoryKey : a reference to current application's NSURLIsDirectoryKey
lns3.scpt
property NSFileManager : a reference to current application's NSFileManager
lns3.scpt
property NSURLIsPackageKey : a reference to current application's NSURLIsPackageKey
lns3.scpt
property NSURLPathKey : a reference to current application's NSURLPathKey
lns3.scpt
property NSURLTagNamesKey : a reference to current application's NSURLTagNamesKey
lns3.scpt
property copyString : " copy" -- added to file names for copies; edit to suit your language
lns3.scpt
on create duplicate of aFileOrPath
lns3.scpt
return my duplicateItem:aFileOrPath
lns3.scpt
end create duplicate of
lns3.scpt
on copy object aFileOrPath to folder folderOrPath replacing replaceFlag : false new name destName : missing value return path pathFlag : false
lns3.scpt
return my copyWithResultItem:aFileOrPath intoFolder:folderOrPath withReplacing:replaceFlag newName:destName withReturnPath:pathFlag
lns3.scpt
end copy object
lns3.scpt
on move object aFileOrPath to folder folderOrPath replacing replaceFlag : false new name destName : missing value return path pathFlag : false
lns3.scpt