text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
end toggleVoiceControl
|
system-settings.applescript
|
on clickAccessibilityCommands()
|
system-settings.applescript
|
if running of application "System Settings" is false then return false
|
system-settings.applescript
|
set searchFieldPresent to exists (first text field of sheet 1 of window "Voice Control" whose value of attribute "AXIdentifier" is "Search Field")
|
system-settings.applescript
|
set doneButtonPresent to exists (button "Done" of sheet 1 of window "Voice Control")
|
system-settings.applescript
|
if searchFieldPresent and doneButtonPresent then return true
|
system-settings.applescript
|
logger's debug("Not already showing target sheet")
|
system-settings.applescript
|
script ClickRetrier
|
system-settings.applescript
|
click (first button of scroll area 1 of group 1 of group 2 of splitter group 1) -- Ventura removed the ability to click via name
|
system-settings.applescript
|
if (exec of retry on result for 50 by 0.1) is missing value then return false
|
system-settings.applescript
|
script FilterWaiter
|
system-settings.applescript
|
tell application "System Events" to tell process "System Settings" to tell window "Voice Control"
|
system-settings.applescript
|
if exists text field 1 of sheet 1 then return true
|
system-settings.applescript
|
set waitResult to exec of retry on result for 50 by 0.1
|
system-settings.applescript
|
end clickAccessibilityCommands
|
system-settings.applescript
|
on clickVocabulary()
|
system-settings.applescript
|
set listPresent to exists (table 1 of scroll area 1 of sheet 1 of window "Accessibility")
|
system-settings.applescript
|
set addButtonPresent to exists (first button of group 1 of sheet 1 of window "Accessibility" whose description is "add")
|
system-settings.applescript
|
set saveButtonPresent to exists (button "Save" of sheet 1 of window "Accessibility")
|
system-settings.applescript
|
if listPresent and addButtonPresent and saveButtonPresent then return true
|
system-settings.applescript
|
tell application "System Events" to tell process "System Preferences" to tell window "Accessibility" to tell first group
|
system-settings.applescript
|
click (first button whose name starts with "Vocabulary")
|
system-settings.applescript
|
if (exec of retry on result for 50 by 0.1) is false then return false
|
system-settings.applescript
|
if exists (first button of group 1 of sheet 1 of window "Accessibility" whose description is "add") then return true
|
system-settings.applescript
|
end clickVocabulary
|
system-settings.applescript
|
on filterCommandsAndEnable(commandKeyword)
|
system-settings.applescript
|
_filterCommandsAndSetState(commandKeyword, 1)
|
system-settings.applescript
|
end filterCommandsAndEnable
|
system-settings.applescript
|
on filterCommandsAndDisable(commandKeyword)
|
system-settings.applescript
|
_filterCommandsAndSetState(commandKeyword, 0)
|
system-settings.applescript
|
end filterCommandsAndDisable
|
system-settings.applescript
|
on _filterCommandsAndSetState(commandLabel, newState)
|
system-settings.applescript
|
set value of text field 1 of sheet 1 to commandLabel
|
system-settings.applescript
|
delay 0.2 -- breaks/does not work without this delay, retry doesn't work either.
|
system-settings.applescript
|
logger's debug("Iterating...")
|
system-settings.applescript
|
repeat with nextRow in rows of table 1 of scroll area 1 of sheet 1
|
system-settings.applescript
|
if value of static text 1 of UI element 1 of nextRow is equal to commandLabel then
|
system-settings.applescript
|
set currentValue to value of checkbox 1 of UI element 1 of nextRow
|
system-settings.applescript
|
if currentValue is equal to the newState then return false
|
system-settings.applescript
|
click checkbox 1 of UI element 1 of nextRow
|
system-settings.applescript
|
end _filterCommandsAndSetState
|
system-settings.applescript
|
on enableTurnOffVoiceControl()
|
system-settings.applescript
|
if clickAccessibilityCommands() is false then return false
|
system-settings.applescript
|
filterCommandsAndEnable("Turn off Voice Control")
|
system-settings.applescript
|
tell application "System Events" to tell process "System Settings" to tell window "Accessibility" to tell first sheet
|
system-settings.applescript
|
end enableTurnOffVoiceControl
|
system-settings.applescript
|
on unlockSecurityAccessibilityPrivacy()
|
system-settings.applescript
|
usr's cueForTouchId()
|
system-settings.applescript
|
exec of retry on result for 10 by 0.5
|
system-settings.applescript
|
script UnlockWaiter
|
system-settings.applescript
|
tell application "System Events" to tell application process "System Preferences"
|
system-settings.applescript
|
button "Click the lock to prevent further changes." of window "Security & Privacy" exists
|
system-settings.applescript
|
end unlockSecurityAccessibilityPrivacy
|
system-settings.applescript
|
on quitApp()
|
system-settings.applescript
|
if running of application "System Settings" is false then return
|
system-settings.applescript
|
do shell script "killall 'System Settings'"
|
system-settings.applescript
|
repeat while running of application "System Settings" is true
|
system-settings.applescript
|
end quitApp
|
system-settings.applescript
|
set my logger to std's import("logger")'s new("system-preferences")
|
system-settings.applescript
|
return run script (POSIX file "/Users/IceHe/Documents/AppleScript/Stat/add_day_log.applescript")
|
Today_Log.applescript
|
clipboard info
|
clipboard info.applescript
|
do shell script "'/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession' -suspend"
|
Lock Screen copy.applescript
|
set graphics_folder_path to (choose folder with prompt "Choose the folder containing the graphics:") as text
|
replacing tags with images.applescript
|
set error_string to "" -- This will contain any error info
|
replacing tags with images.applescript
|
set find grep preferences to nothing
|
replacing tags with images.applescript
|
tell find change grep options
|
replacing tags with images.applescript
|
set include footnotes to false
|
replacing tags with images.applescript
|
set include hidden layers to false
|
replacing tags with images.applescript
|
set include locked layers for find to false
|
replacing tags with images.applescript
|
set include master pages to false
|
replacing tags with images.applescript
|
set find what of find grep preferences to "<[^>]+?>"
|
replacing tags with images.applescript
|
set doc_folder_path to file path as text
|
replacing tags with images.applescript
|
my make_links_folder(doc_folder_path)
|
replacing tags with images.applescript
|
set the_instances to find grep
|
replacing tags with images.applescript
|
repeat with i from (count the_instances) to 1 by -1
|
replacing tags with images.applescript
|
set the_graphic_name to text from character 2 to character -2 of contents of item i of the_instances
|
replacing tags with images.applescript
|
set required_height to ascent of character 1 of item i of the_instances
|
replacing tags with images.applescript
|
set the_original_file to my find_graphic_file(graphics_folder_path, the_graphic_name)
|
replacing tags with images.applescript
|
if the_original_file = missing value then
|
replacing tags with images.applescript
|
set error_string to error_string & "Missing file for " & the_graphic_name & return
|
replacing tags with images.applescript
|
set graphics_path to my prepare_graphic(the_original_file, the_graphic_name, doc_folder_path, required_height)
|
replacing tags with images.applescript
|
if graphics_path = missing value then
|
replacing tags with images.applescript
|
set error_string to error_string & "Problem processing " & the_graphic_name & return
|
replacing tags with images.applescript
|
delete item i of the_instances
|
replacing tags with images.applescript
|
set {the_new_graphic} to place alias graphics_path on insertion point 1 of item i of the_instances
|
replacing tags with images.applescript
|
tell the_new_graphic
|
replacing tags with images.applescript
|
set {y1, x1, y2, x2} to geometric bounds
|
replacing tags with images.applescript
|
set actual_height to y2 - y1
|
replacing tags with images.applescript
|
set needed_scale to required_height / actual_height * 100
|
replacing tags with images.applescript
|
set properties to {vertical scale:needed_scale, horizontal scale:needed_scale}
|
replacing tags with images.applescript
|
fit given frame to content
|
replacing tags with images.applescript
|
set no break of text from character 1 of item i of the_instances to character 2 of item i of the_instances to true
|
replacing tags with images.applescript
|
if error_string = "" then
|
replacing tags with images.applescript
|
set final_message to "Finished."
|
replacing tags with images.applescript
|
set final_message to "The following errors occurred:" & return & return & error_string
|
replacing tags with images.applescript
|
with timeout of 10000 seconds
|
replacing tags with images.applescript
|
display dialog final_message buttons {"OK"} default button 1
|
replacing tags with images.applescript
|
on make_links_folder(doc_folder_path)
|
replacing tags with images.applescript
|
if not (exists folder "Links" of folder doc_folder_path) then
|
replacing tags with images.applescript
|
make new folder at folder doc_folder_path with properties {name:"Links"}
|
replacing tags with images.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.