text
stringlengths
0
15.7k
source
stringlengths
6
112
set frameName to item 1 of argv
focus-emacs-frame.applescript
set frame to findFrame(frameName)
focus-emacs-frame.applescript
if frame is not false then
focus-emacs-frame.applescript
focusFrame(frame)
focus-emacs-frame.applescript
on focusApp()
focus-emacs-frame.applescript
set frontmost of process "emacs" to true
focus-emacs-frame.applescript
end focusApp
focus-emacs-frame.applescript
on focusFrame(frame)
focus-emacs-frame.applescript
tell application "System Events" to tell process "emacs"
focus-emacs-frame.applescript
perform action "AXRaise" of frame
focus-emacs-frame.applescript
end focusFrame
focus-emacs-frame.applescript
on findFrame(frameName)
focus-emacs-frame.applescript
local selectedFrameName
focus-emacs-frame.applescript
local selectedFrame
focus-emacs-frame.applescript
set frames to (every UI element whose subrole is "AXStandardWindow")
focus-emacs-frame.applescript
if frames is {} then set frames to (every UI element whose subrole is "AXDialog")
focus-emacs-frame.applescript
if frames is {} then
focus-emacs-frame.applescript
repeat with frame in frames
focus-emacs-frame.applescript
if name of frame starts with frameName then
focus-emacs-frame.applescript
end findFrame
focus-emacs-frame.applescript
tell (calendars whose name contains "Year")
Delete Work Calendars.applescript
delete
Delete Work Calendars.applescript
on posixDate(datetime)
unix_dates.scpt
set command to "date -j -f '%A, %B %e, %Y at %I:%M:%S %p' '" & datetime & "'"
unix_dates.scpt
set command to command & " +%Y%m%d%H%M.%S"
unix_dates.scpt
set thePosixDate to do shell script command
unix_dates.scpt
return thePosixDate
unix_dates.scpt
end posixDate
unix_dates.scpt
on unixDate(datetime)
unix_dates.scpt
set command to command & " +%s"
unix_dates.scpt
set theUnixDate to do shell script command
unix_dates.scpt
return theUnixDate
unix_dates.scpt
end unixDate
unix_dates.scpt
tell process "Script Menu"
Click-Script-Menu.applescript
do JavaScript "navigator.clipboard.writeText($('.selected-segment').text())"
copy_splunk_value.applescript
disconnect "client1"
disconnect_vpn.applescript
property myTitle : "Export Playlists"
ExportPlaylists.applescript
global iconApp
ExportPlaylists.applescript
global iconWarning
ExportPlaylists.applescript
global iconError
ExportPlaylists.applescript
global originalDelimiter
ExportPlaylists.applescript
global illegalCharacters1
ExportPlaylists.applescript
global illegalCharacters2
ExportPlaylists.applescript
global attrShow
ExportPlaylists.applescript
global folderChoice
ExportPlaylists.applescript
global nameChoice
ExportPlaylists.applescript
global dupeLimit
ExportPlaylists.applescript
global playlistsExported
ExportPlaylists.applescript
global songsExported
ExportPlaylists.applescript
global maxPathComponentLength
ExportPlaylists.applescript
global ellipsisChar
ExportPlaylists.applescript
set progress description to "Preparing…"
ExportPlaylists.applescript
set iconApp to 1 -- [icon note]
ExportPlaylists.applescript
set iconWarning to 2 -- [icon caution]
ExportPlaylists.applescript
set iconError to 0 -- [icon stop]
ExportPlaylists.applescript
set dupeLimit to 100 -- [allow up to this many duplicate files; set limit to avoid possible infinite loop]
ExportPlaylists.applescript
set maxPathComponentLength to 255 -- [the maximum length of a component of the new file's path]
ExportPlaylists.applescript
set ellipsisChar to "..." -- [character to use when truncating long names. Example: 3 full stops (...) or the ellipsis character (…)]
ExportPlaylists.applescript
set playlistsExported to 0
ExportPlaylists.applescript
set songsExported to 0
ExportPlaylists.applescript
set illegalCharacters1 to {"~", "?", "!", "@", "#", "$", "%", "&", "*", "=", "+", "{", "}", "<", ">", "|", "\\", "/", ";", ":", "×", "÷"}
ExportPlaylists.applescript
set illegalCharacters2 to {"'", "\"", ",", "`", "^", "˘"}
ExportPlaylists.applescript
with timeout of 60 * 60 * 24 seconds -- (timeout of 24 hours for many huge playlists, slow computer/network, etc.)
ExportPlaylists.applescript
set delim to "--------------------------------------------------"
ExportPlaylists.applescript
set delim_specialpl to "---------------- Special Playlists: ----------------"
ExportPlaylists.applescript
set delim_userpl to "------------------ User Playlists: -----------------"
ExportPlaylists.applescript
set delim_smartpl to "---------------- Smart Playlists: -----------------"
ExportPlaylists.applescript
set all_ps to {}
ExportPlaylists.applescript
set all_specialps to (get name of every user playlist whose special kind is not none)
ExportPlaylists.applescript
on error number -1728 ------ No special playlists exist
ExportPlaylists.applescript
set all_smartps to {}
ExportPlaylists.applescript
if ((length of all_specialps) > 0) then
ExportPlaylists.applescript
set the end of all_ps to delim
ExportPlaylists.applescript
set the end of all_ps to delim_specialpl
ExportPlaylists.applescript
repeat with ps in all_specialps
ExportPlaylists.applescript
set the end of all_ps to ps
ExportPlaylists.applescript
set all_userps to (get name of every user playlist whose smart is false and special kind is none)
ExportPlaylists.applescript
on error number -1728 ------ No user playlists exist
ExportPlaylists.applescript
if ((length of all_userps) > 0) then
ExportPlaylists.applescript
set the end of all_ps to delim_userpl
ExportPlaylists.applescript
repeat with ps in all_userps
ExportPlaylists.applescript
set all_smartps to (get name of every user playlist whose smart is true and special kind is none)
ExportPlaylists.applescript
on error number -1728 ------ No smart playlists exist
ExportPlaylists.applescript
if ((length of all_smartps) > 0) then
ExportPlaylists.applescript
set the end of all_ps to delim_smartpl
ExportPlaylists.applescript
repeat with ps in all_smartps
ExportPlaylists.applescript
set thePlaylistsNames to (choose from list all_ps with prompt ({"Choose which playlists to export.", return, "[can choose multiple out of ", (length of all_specialps as string), " special playlists, ", (length of all_userps as string), " user playlists, and ", (length of all_smartps as string), " smart playlists]"} as string) with title myTitle with multiple selections allowed)
ExportPlaylists.applescript
if thePlaylistsNames is false then return
ExportPlaylists.applescript
set thePlaylistsNumber to (count of thePlaylistsNames)
ExportPlaylists.applescript
set thePlaylistsNumberInvalid to my count_matches(thePlaylistsNames, "---------------")
ExportPlaylists.applescript
set thePlaylistsNumberGood to (thePlaylistsNumber - thePlaylistsNumberInvalid)
ExportPlaylists.applescript
my log_out("Playlists chosen:", thePlaylistsNames)
ExportPlaylists.applescript
set thePlaylistsNamesClean to {}
ExportPlaylists.applescript
repeat with i from 1 to thePlaylistsNumber
ExportPlaylists.applescript
if ({thePlaylistsNames's item i} as string) does not contain "---------------" then set thePlaylistsNamesClean's end to thePlaylistsNames's item i
ExportPlaylists.applescript
set thePlaylistsNamesLength to {}
ExportPlaylists.applescript
set thePlaylistsNumberZero to 0
ExportPlaylists.applescript
repeat with i from 1 to thePlaylistsNumberGood
ExportPlaylists.applescript
set thisPlaylistName to (item i of thePlaylistsNamesClean)
ExportPlaylists.applescript
set thisPlaylist to (get some playlist whose name is thisPlaylistName)
ExportPlaylists.applescript