text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set outputDuration to the result
|
export_timesheet copy.scpt
|
set summaryText to my replace_chars(the summary of myEvent, "\"", "\"\"")
|
export_timesheet copy.scpt
|
set outputLine to (outputDate) & " " & outputTime & "," & outputDuration & ",\"" & (summaryText) & "\""
|
export_timesheet copy.scpt
|
set end of output to outputLine as text
|
export_timesheet copy.scpt
|
set AppleScript's text item delimiters to {ASCII character 10}
|
export_timesheet copy.scpt
|
set saveFile to choose file name with prompt "Save timesheet as:" default name fileName
|
export_timesheet copy.scpt
|
set the open_target_file to open for access saveFile with write permission
|
export_timesheet copy.scpt
|
write (output as text) to the open_target_file starting at 0
|
export_timesheet copy.scpt
|
close access the open_target_file
|
export_timesheet copy.scpt
|
do shell script "sort -o " & quoted form of POSIX path of saveFile & " " & quoted form of POSIX path of saveFile
|
export_timesheet copy.scpt
|
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
|
ScreenDimFlash.applescript
|
tell process "System Preferences" to set visible to false
|
ScreenDimFlash.applescript
|
set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 0.5
|
ScreenDimFlash.applescript
|
set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 1
|
ScreenDimFlash.applescript
|
set folderOrigen to (choose folder with prompt "Selecciona la carpeta de origen") as alias
|
moverArchivos.scpt
|
set folderDestino to (choose folder with prompt "Selecciona la carpeta de destino") as alias
|
moverArchivos.scpt
|
set folderOrigenPOSIXPath to (the POSIX path of folderOrigen)
|
moverArchivos.scpt
|
set folderDestinoPOSIXPath to (the POSIX path of folderDestino)
|
moverArchivos.scpt
|
set comandoMover to "mv " & folderOrigenPOSIXPath & "* " & folderDestinoPOSIXPath
|
moverArchivos.scpt
|
do shell script comandoMover
|
moverArchivos.scpt
|
display notification "Todos los archivos han sido movidos" with title "Proceso completado"
|
moverArchivos.scpt
|
set theFolder to POSIX path of ((the path to me as text) & "::")
|
volume-up.scpt
|
set Controller to run script ("script s" & return & (read alias (POSIX file (theFolder & "/lib/controller.scpt")) as «class utf8») & return & "end script " & return & "return s")
|
volume-up.scpt
|
Controller's control(187)
|
volume-up.scpt
|
openDataFolder()
|
Open Data Folder for Currently Running App in Terminal.applescript
|
on openDataFolder()
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set theProcess to do shell script "ps ax | grep -E \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/.*/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }'"
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/data/Containers/Data/Application/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\" | grep -v grep | awk '{ print $1 }' | head -n 1"
|
Open Data Folder for Currently Running App in Terminal.applescript
|
if thePath is equal to "" then
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set thePath to do shell script "lsof -p " & theProcess & " | grep -oE \"/.*Library/Developer/CoreSimulator/Devices/[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}/\" | grep -v grep | awk '{ print $1 }' | head -n 1"
|
Open Data Folder for Currently Running App in Terminal.applescript
|
if exists (processes where name is "Terminal") then
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set theWindow to do script ""
|
Open Data Folder for Currently Running App in Terminal.applescript
|
do script "cd " & quoted form of thePath in theWindow
|
Open Data Folder for Currently Running App in Terminal.applescript
|
else if exists (processes where name is "kitty") then
|
Open Data Folder for Currently Running App in Terminal.applescript
|
else if exists (processes where name is "iTerm2") then
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set theWindow to (create window with default profile)
|
Open Data Folder for Currently Running App in Terminal.applescript
|
tell theWindow
|
Open Data Folder for Currently Running App in Terminal.applescript
|
tell current session of theWindow
|
Open Data Folder for Currently Running App in Terminal.applescript
|
write text "cd " & the quoted form of thePath
|
Open Data Folder for Currently Running App in Terminal.applescript
|
end openDataFolder
|
Open Data Folder for Currently Running App in Terminal.applescript
|
set theCurrentTrackProperties to get properties of current track --@yuuiko Get currently playing song information from iTunes
|
songlink.applescript
|
set theURL to "https://itunes.apple.com/search?term=" & name of theCurrentTrackProperties & " " & artist of theCurrentTrackProperties & "&limit=1" --@yuuiko build link of the itunes website search, which only returns the first result
|
songlink.applescript
|
set fixedURL to replaceText(" ", "%20", theURL) --@yuuiko emove spaces from itunes websearch and replace with "%20"
|
songlink.applescript
|
set curlTask to "curl " & fixedURL --@yuuiko construct shell script command for itunes websearch
|
songlink.applescript
|
set searchResult to do shell script curlTask --@yuuiko do the shell script itunes websearch and return JSON
|
songlink.applescript
|
set AppleScript's text item delimiters to {","}
|
songlink.applescript
|
set keyValueList to (every text item in searchResult) as list
|
songlink.applescript
|
repeat with thiskeyValuePair from 1 to 13 --@yuuiko this seems to control which property it extracts
|
songlink.applescript
|
set theKeyValuePair to item thiskeyValuePair of keyValueList --@yuuiko extract the right info
|
songlink.applescript
|
set theKeyValuePairTrimmedStart to ((characters 23 thru -1 of theKeyValuePair) as string) --@yuuiko trim first 24? characters out
|
songlink.applescript
|
set theKeyValuePairTrimmedEnd to ((characters 1 thru -2 of theKeyValuePairTrimmedStart) as string) --@yuuiko trim last 2? characters out
|
songlink.applescript
|
set trackUrl to theKeyValuePairTrimmedEnd --Yay! we go the link. (sigh.. all that to get this one URL.)
|
songlink.applescript
|
set windowHeight to 535
|
songlink.applescript
|
set windowWidth to 300
|
songlink.applescript
|
set screenResolution to bounds of window of desktop
|
songlink.applescript
|
set screenWidth to item 3 of screenResolution
|
songlink.applescript
|
set screenHeight to item 4 of screenResolution
|
songlink.applescript
|
make new document
|
songlink.applescript
|
set properties of current tab to ({URL:"https://song.link/" & trackUrl})
|
songlink.applescript
|
set yAxis to (screenHeight - windowHeight) / 2 as integer
|
songlink.applescript
|
set xAxis to (screenWidth - windowWidth) / 2 as integer
|
songlink.applescript
|
set the bounds of the first window to {xAxis, yAxis, windowWidth + xAxis, windowHeight + yAxis}
|
songlink.applescript
|
on replaceText(find, replace, subject)
|
songlink.applescript
|
set subject to text items of subject
|
songlink.applescript
|
set subject to subject as text
|
songlink.applescript
|
return subject
|
songlink.applescript
|
tell application "System Events" to set openapps to name of every application process whose visible is true and name is not "Finder"
|
time_to_code.applescript
|
set keepapp to {""}
|
time_to_code.applescript
|
repeat with closeapps in openapps
|
time_to_code.applescript
|
if closeapps is not in keepapp then quit application closeapps
|
time_to_code.applescript
|
tell application "CodeRunner" to activate
|
time_to_code.applescript
|
tell application "AppleScript Editor" to activate
|
time_to_code.applescript
|
tell application "iTunes" to play playlist "Developing"
|
time_to_code.applescript
|
tell app "Finder"
|
getFinderPath.applescript
|
set selectedItem to quoted form of (posix path of (the selection as alias))
|
getFinderPath.applescript
|
set target_folder to (POSIX file "/Users/IceHe/Pictures")
|
to_folder_pictures.applescript
|
if front Finder window exists then
|
to_folder_pictures.applescript
|
set target of front Finder window to target_folder
|
to_folder_pictures.applescript
|
open target_folder
|
to_folder_pictures.applescript
|
use AppleScript version "2.5" -- Sierra (10.12) or later for new enumerations
|
NSPopover.applescript
|
to showPopover for targetView given controls:controls : {}, rect:rect : {{0, 0}, {0, 0}}, edge:edge : 0, padding:padding : {20, 20}, animates:animates : true, behavior:behavior : 1
|
NSPopover.applescript
|
set popoverView to makeViewController for controls given padding:padding -- create viewController for the controls
|
NSPopover.applescript
|
set popover to makePopover for popoverView given animates:animates, behavior:behavior -- create popover
|
NSPopover.applescript
|
popover's showRelativeToRect:rect ofView:targetView preferredEdge:edge -- show popover
|
NSPopover.applescript
|
return popover
|
NSPopover.applescript
|
end showPopover
|
NSPopover.applescript
|
to makePopover for viewController given animates:animates : true, behavior:behavior : 1
|
NSPopover.applescript
|
tell current application's NSPopover's alloc's init()
|
NSPopover.applescript
|
if animates is not true then its setAnimates:false
|
NSPopover.applescript
|
if behavior is not 0 then its setBehavior:behavior -- 0 = needs to be closed, 1 = transient
|
NSPopover.applescript
|
its setContentViewController:viewController
|
NSPopover.applescript
|
its setContentSize:(second item of viewController's view's frame())
|
NSPopover.applescript
|
return it
|
NSPopover.applescript
|
end makePopover
|
NSPopover.applescript
|
to makeViewController for controls given padding:padding : {20, 20}
|
NSPopover.applescript
|
set {maxWidth, maxHeight} to {0, 0}
|
NSPopover.applescript
|
set viewController to current application's NSViewController's alloc's init
|
NSPopover.applescript
|
viewController's setView:(current application's NSView's alloc's initWithFrame:{{0, 0}, {0, 0}})
|
NSPopover.applescript
|
repeat with anItem in (controls as list)
|
NSPopover.applescript
|
set {width, height} to last item of anItem's frame() as list
|
NSPopover.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.