text
stringlengths
0
15.7k
source
stringlengths
6
112
property BootArgs : ""
AppDelegate.applescript
set OpenCoreVersion to ( do shell script "nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version | awk '{print $2}'" )
AppDelegate.applescript
setOpenCoreVersion_(OpenCoreVersion as string)
AppDelegate.applescript
set BootPath to ( do shell script "nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | awk '{print $2}'" )
AppDelegate.applescript
set OemProduct to ( do shell script "nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product | awk '{print $2}'" )
AppDelegate.applescript
set OemVendor to ( do shell script "nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-vendor | awk '{print $2}'" )
AppDelegate.applescript
set OemBoard to ( do shell script "nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-board | awk '{print $2}'" )
AppDelegate.applescript
if OemBoard is not "Z77MX-QUO-AOS" then
AppDelegate.applescript
display alert "This utility is not safe to use on other motherboard because of assumptions made"
AppDelegate.applescript
set theStatusText to "Please choose the Config.plist file to affect."
AppDelegate.applescript
set theTask to (current application's NSTask's launchedTaskWithLaunchPath:"/usr/bin/say" arguments:{theStatusText})
AppDelegate.applescript
set Config to quoted form of (POSIX path of ( choose file with prompt "Please select Config.plist:" of type {"plist"} ))
AppDelegate.applescript
theTask's terminate()
AppDelegate.applescript
set validPlist to (do shell script "plutil -s " & Config )
AppDelegate.applescript
if validPlist is not "" then
AppDelegate.applescript
display alert "This file is not a valid plist file"
AppDelegate.applescript
set theSystemProductName to (do shell script "/usr/libexec/PlistBuddy -c \"Print :PlatformInfo:Generic:SystemProductName \" " & Config )
AppDelegate.applescript
if theSystemProductName is not in SystemProductNameItems then
AppDelegate.applescript
display alert "SMBIOS IS NOT SUPPORTED " &theSystemProductName
AppDelegate.applescript
setSystemProductName_(theSystemProductName as string)
AppDelegate.applescript
set theShowPicker to (do shell script "/usr/libexec/PlistBuddy -c \"Print :Misc:Boot:ShowPicker \" " & Config )
AppDelegate.applescript
setShowPicker_(theShowPicker as boolean)
AppDelegate.applescript
set thePickerMode to (do shell script "/usr/libexec/PlistBuddy -c \"Print :Misc:Boot:PickerMode \" " & Config )
AppDelegate.applescript
setPickerMode_(thePickerMode as string)
AppDelegate.applescript
set theTimeout to (do shell script "/usr/libexec/PlistBuddy -c \"Print :Misc:Boot:Timeout \" " & Config )
AppDelegate.applescript
setPickerTimeout_(theTimeout as integer)
AppDelegate.applescript
set theBootArgs to (do shell script "/usr/libexec/PlistBuddy -c \"Print :NVRAM:Add:7C436110-AB2A-4BBB-A880-FE41995C9F82:boot-args \" " & Config )
AppDelegate.applescript
setBootArgs_(theBootArgs as string)
AppDelegate.applescript
on pitonDone_(sender)
AppDelegate.applescript
"OEM Board : " & OemBoard & "\n" & ¬
AppDelegate.applescript
"Boot Path : " & BootPath
AppDelegate.applescript
end pitonDone_
AppDelegate.applescript
on pitonSMBIOS_(sender)
AppDelegate.applescript
end pitonSMBIOS_
AppDelegate.applescript
on pitonBootPicker_(sender)
AppDelegate.applescript
if ShowPicker as boolean is true then
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :Misc:Boot:ShowPicker true\" " & Config)
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :Misc:Boot:ShowPicker false\" " & Config)
AppDelegate.applescript
end pitonBootPicker_
AppDelegate.applescript
on pitonPickerMode_(sender)
AppDelegate.applescript
if PickerMode as string = "Builtin" then
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :Misc:Boot:PickerMode Builtin\" " & Config)
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :Misc:Boot:PickerMode External\" " & Config)
AppDelegate.applescript
end pitonPickerMode_
AppDelegate.applescript
on pitonPickerTimeout_(sender)
AppDelegate.applescript
set x to PickerTimeout as string
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :Misc:Boot:Timeout " & x & "\" " & Config)
AppDelegate.applescript
end pitonPickerTimeout_
AppDelegate.applescript
on pitonBootArgs_(sender)
AppDelegate.applescript
set x to BootArgs as string
AppDelegate.applescript
do shell script ("/usr/libexec/PlistBuddy -c \"Set :NVRAM:Add:7C436110-AB2A-4BBB-A880-FE41995C9F82:boot-args " & x & "\" " & Config)
AppDelegate.applescript
end pitonBootArgs_
AppDelegate.applescript
set wait_time to 30
auto_keyinputfor_runtest.scpt
set key_str to "b"
auto_keyinputfor_runtest.scpt
set repeat_count to 100
auto_keyinputfor_runtest.scpt
set key_scenetime to 20
auto_keyinputfor_runtest.scpt
set app_name to "@@@@.app"
auto_keyinputfor_runtest.scpt
repeat repeat_count times
auto_keyinputfor_runtest.scpt
tell application app_name
auto_keyinputfor_runtest.scpt
tell application process app_name
auto_keyinputfor_runtest.scpt
delay key_scenetime
auto_keyinputfor_runtest.scpt
keystroke key_str
auto_keyinputfor_runtest.scpt
delay wait_time
auto_keyinputfor_runtest.scpt
set timeoutSeconds to 2.0
PS4AutoPlay.scpt
set RemotePS4App to "RemotePlay"
PS4AutoPlay.scpt
repeat with i from 1 to 60 * 9.5 # the loop takes 9.5 hours.
PS4AutoPlay.scpt
tell application RemotePS4App
PS4AutoPlay.scpt
log "target window activated."
PS4AutoPlay.scpt
repeat with i from 1 to 11 # the loop takes 1 minute.
PS4AutoPlay.scpt
delay 2.5
PS4AutoPlay.scpt
log "send key [up]"
PS4AutoPlay.scpt
my sendKey(RemotePS4App, "key code 126", timeoutSeconds) #send [up]
PS4AutoPlay.scpt
log "send key [return]"
PS4AutoPlay.scpt
my sendKey(RemotePS4App, "key code 36", timeoutSeconds) #send [return]
PS4AutoPlay.scpt
on sendKey(applicationName, uiScript, timeoutSeconds)
PS4AutoPlay.scpt
set activeApp to name of first application process whose frontmost is true
PS4AutoPlay.scpt
if applicationName is not in activeApp then
PS4AutoPlay.scpt
log "pass the sendKey. target window is inactive."
PS4AutoPlay.scpt
set endDate to (current date) + timeoutSeconds
PS4AutoPlay.scpt
run script "tell application \"System Events\"
PS4AutoPlay.scpt
" & uiScript & "
PS4AutoPlay.scpt
if ((current date) > endDate) then
PS4AutoPlay.scpt
error "Can not " & uiScript
PS4AutoPlay.scpt
end sendKey
PS4AutoPlay.scpt
1 / 0
hello-with-error-handling.applescript
on error the errorMessage number the errorNumber
hello-with-error-handling.applescript
std's catch(scriptName, errorNumber, errorMessage)
hello-with-error-handling.applescript
property randomSeed: 20
raytracer.applescript
property numSMPWorkers: 16
raytracer.applescript
property renderConfig: {imageWidth: 400, samplesPerPixel: 4, maxBounces: 50} -- med quality
raytracer.applescript
on makeColor(r, g, b)
raytracer.applescript
{red: r, green: g, blue: b}
raytracer.applescript
on printRGB(r, g, b)
raytracer.applescript
set colr to (round (256 * r) rounding down)
raytracer.applescript
set colg to (round (256 * g) rounding down)
raytracer.applescript
set colb to (round (256 * b) rounding down)
raytracer.applescript
log ("" & colr & " " & colg & " " & colb)
raytracer.applescript
on printColor(color)
raytracer.applescript
set colr to (round (256 * (red in color)) rounding down)
raytracer.applescript
set colg to (round (256 * (green in color)) rounding down)
raytracer.applescript