text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
tell application "System Events" to tell process "System Preferences" to tell window "Accessibility" to tell first sheet
|
system-preferences.applescript
|
if running of application "System Preferences" is false then return
|
system-preferences.applescript
|
do shell script "killall 'System Preferences'"
|
system-preferences.applescript
|
repeat while running of application "System Preferences" is true
|
system-preferences.applescript
|
property theContextName : "Wait for" -- the context to set the task to
|
SetWaitFor.scpt
|
set theContext to first flattened tag where its name = theContextName --and the name of its container = "Store"
|
SetWaitFor.scpt
|
set theTasksSelected to my getSelectedTasks()
|
SetWaitFor.scpt
|
my processTask(theItem, theContext)
|
SetWaitFor.scpt
|
on processTask(theTask, theContext)
|
SetWaitFor.scpt
|
log (name of tag of theTask)
|
SetWaitFor.scpt
|
set tag of theTask to theContext
|
SetWaitFor.scpt
|
end processTask
|
SetWaitFor.scpt
|
on getSelectedTasks()
|
SetWaitFor.scpt
|
return theTasksSelected
|
SetWaitFor.scpt
|
set theWindowX to (theScreenWidth / 2 - theWindowWidth) / 2
|
Resize Screencast Window Square Left.applescript
|
global std, textUtil, sessionPlist
|
cliclick.applescript
|
global CLICLICK_CLI
|
cliclick.applescript
|
property savedPosition : missing value
|
cliclick.applescript
|
logger's infof("Current Coord: {}:{}", getCurrentCoord())
|
cliclick.applescript
|
set sutUi to text field 1 of list 1 of scroll area 1 of splitter group 1 of splitter group 1 of front window
|
cliclick.applescript
|
lclick at the sutUi with reset and smoothing
|
cliclick.applescript
|
on clickRelative at theWindow given fromLeft:pLeft : missing value, fromBottom:pBottom : missing value, fromTop:pTop : missing value, fromRight:pRight : missing value
|
cliclick.applescript
|
tell theWindow -- do not merge with above, it will fail.
|
cliclick.applescript
|
set {x, y} to its position
|
cliclick.applescript
|
set {w, h} to its size
|
cliclick.applescript
|
if pLeft is not missing value then set theX to pLeft + x
|
cliclick.applescript
|
if pBottom is not missing value then
|
cliclick.applescript
|
if y is less than 0 then -- 2nd screen
|
cliclick.applescript
|
set theY to y + h - pBottom
|
cliclick.applescript
|
lclickAtXy(theX, theY)
|
cliclick.applescript
|
end clickRelative
|
cliclick.applescript
|
on drag from startPos onto endPos
|
cliclick.applescript
|
set origPos to do shell script CLICLICK_CLI & " p:."
|
cliclick.applescript
|
set origPos to textUtil's replace(origPos, "-", "=-")
|
cliclick.applescript
|
set calcStart to formatCoordinates(first item of startPos, last item of startPos)
|
cliclick.applescript
|
set calcEnd to formatCoordinates(first item of endPos, last item of endPos)
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " -e 1 dd:" & calcStart & " du:" & calcEnd & " c:" & calcEnd
|
cliclick.applescript
|
do shell script clickCommand
|
cliclick.applescript
|
do shell script CLICLICK_CLI & " m:" & origPos
|
cliclick.applescript
|
end drag
|
cliclick.applescript
|
on dragFromTo(x1, y1, x2, y2)
|
cliclick.applescript
|
if y1 is less than 0 then
|
cliclick.applescript
|
set y1 to "=" & y1
|
cliclick.applescript
|
if y2 is less than 0 then
|
cliclick.applescript
|
set y2 to "=" & y2
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " -e 1 dd:" & x1 & "," & y1 & " du:" & x2 & "," & y2 & " c:" & x2 & "," & y2
|
cliclick.applescript
|
end dragFromTo
|
cliclick.applescript
|
on movePointer at theUi
|
cliclick.applescript
|
set coord to getCoord at theUi
|
cliclick.applescript
|
set formattedCoord to formatCoordinates(item 1 of coord, item 2 of coord)
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " -e 1 m:" & formattedCoord
|
cliclick.applescript
|
end movePointer
|
cliclick.applescript
|
on moveToXy(x, y)
|
cliclick.applescript
|
set formattedCoord to formatCoordinates(x, y)
|
cliclick.applescript
|
end moveToXy
|
cliclick.applescript
|
on rclickAtXy(x, y)
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " -e 1 rc:" & formattedCoord
|
cliclick.applescript
|
end rclickAtXy
|
cliclick.applescript
|
to lclickAtXy(x, y)
|
cliclick.applescript
|
saveCurrentPosition()
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " -e 1 c:" & formattedCoord
|
cliclick.applescript
|
end try -- swallow if the command is not present.
|
cliclick.applescript
|
restorePosition()
|
cliclick.applescript
|
end lclickAtXy
|
cliclick.applescript
|
on lclick at theUi with reset and smoothing
|
cliclick.applescript
|
set smoothingParam to ""
|
cliclick.applescript
|
if smoothing then set smoothingParam to "-e 1 "
|
cliclick.applescript
|
tell theUi
|
cliclick.applescript
|
set {xPosition, yPosition} to position
|
cliclick.applescript
|
set {xSize, ySize} to size
|
cliclick.applescript
|
set theYPos to yPosition + (ySize div 2)
|
cliclick.applescript
|
if theYPos is less than 0 then
|
cliclick.applescript
|
set theYPos to "=" & theYPos
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " " & smoothingParam & "c:" & xPosition + (xSize div 2) & "," & theYPos
|
cliclick.applescript
|
end lclick
|
cliclick.applescript
|
on rclick at theUi with reset and smoothing
|
cliclick.applescript
|
set clickCommand to CLICLICK_CLI & " " & smoothingParam & "rc:" & formattedCoord
|
cliclick.applescript
|
end rclick
|
cliclick.applescript
|
on saveCurrentPosition()
|
cliclick.applescript
|
set my savedPosition to origPos
|
cliclick.applescript
|
sessionPlist's setValue("Pointer Position", origPos)
|
cliclick.applescript
|
end saveCurrentPosition
|
cliclick.applescript
|
on getCurrentPosition()
|
cliclick.applescript
|
set currentPos to do shell script CLICLICK_CLI & " p:."
|
cliclick.applescript
|
return textUtil's replace(currentPos, "-", "=-")
|
cliclick.applescript
|
end getCurrentPosition
|
cliclick.applescript
|
on getCurrentCoord()
|
cliclick.applescript
|
set currentCoord to textUtil's replace(getCurrentPosition(), "=-", "-")
|
cliclick.applescript
|
set xyList to textUtil's split(currentCoord, ",")
|
cliclick.applescript
|
return {first item of xyList, last item of xyList}
|
cliclick.applescript
|
end getCurrentCoord
|
cliclick.applescript
|
on restorePosition()
|
cliclick.applescript
|
set savedPosition to sessionPlist's getValue("Pointer Position")
|
cliclick.applescript
|
logger's debugf("Restoring pointer to: {}", savedPosition)
|
cliclick.applescript
|
do shell script CLICLICK_CLI & " m:" & savedPosition
|
cliclick.applescript
|
end restorePosition
|
cliclick.applescript
|
on getCoord at theUi
|
cliclick.applescript
|
tell application "System Events" to tell theUi
|
cliclick.applescript
|
set theXPos to xPosition + (xSize div 2)
|
cliclick.applescript
|
return {theXPos, theYPos}
|
cliclick.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.