text
stringlengths
0
15.7k
source
stringlengths
6
112
Manual: Extract Meeting ID
dec-calendar-event-zoom.applescript
Extract Meeting Password
dec-calendar-event-zoom.applescript
set calendar to std's import("calendar")'s new()
dec-calendar-event-zoom.applescript
set decoratedEvent to std's import("calendar-event")'s new()
dec-calendar-event-zoom.applescript
if name of decoratedEvent is not "CalendarEventZoomLibrary" then
dec-calendar-event-zoom.applescript
logger's info("Decorating...")
dec-calendar-event-zoom.applescript
set decoratedEvent to decorate(decoratedEvent)
dec-calendar-event-zoom.applescript
error "Already decorated"
dec-calendar-event-zoom.applescript
logger's debugf("Name of calendar event: {}", name of decoratedEvent)
dec-calendar-event-zoom.applescript
set selectedEvent to _spotGetSelectedEvent(decoratedEvent)
dec-calendar-event-zoom.applescript
if selectedEvent is missing value then error "Selected Event is missing value"
dec-calendar-event-zoom.applescript
logger's logObj("selected event", selectedEvent)
dec-calendar-event-zoom.applescript
logger's infof("Meeting ID: {}", selectedEvent's meetingId)
dec-calendar-event-zoom.applescript
logger's infof("Meeting Password: {}", selectedEvent's meetingPassword)
dec-calendar-event-zoom.applescript
on _spotGetSelectedEvent(decoratedEvent)
dec-calendar-event-zoom.applescript
return decoratedEvent's new(selectedEvent)
dec-calendar-event-zoom.applescript
end _spotGetSelectedEvent
dec-calendar-event-zoom.applescript
script CalendarEventZoomLibrary
dec-calendar-event-zoom.applescript
set isSpot to name of current application is "Script Editor"
dec-calendar-event-zoom.applescript
if isSpot is true then
dec-calendar-event-zoom.applescript
regex's firstMatchInString("(?<=zoom\\.us\\/j\\/)\\d+", meetingDescription)
dec-calendar-event-zoom.applescript
regex's firstMatchInString("(?<=pwd=)\\w+", meetingDescription)
dec-calendar-event-zoom.applescript
set logger to std's import("logger")'s new("dec-calendar-event-zoom")
dec-calendar-event-zoom.applescript
set focused of text field 1 of group 1 of splitter group 1 of group 1 to true
autofocus-settings.applescript
global firstRun, waterCount, waterSuffix, waitTime
drink-water.applescript
set firstRun to "no"
drink-water.applescript
set waterCount to 9
drink-water.applescript
set theResponse to display dialog "How many waters have you had so far?" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"
drink-water.applescript
if theResponse = "" then
drink-water.applescript
set firstRun to "yes"
drink-water.applescript
set waterCount to (text returned of theResponse) as integer
drink-water.applescript
if firstRun = "yes" then
drink-water.applescript
set waitTime to ((60 - the (minutes of the (current date))) * 60)
drink-water.applescript
if waterCount ≤ 8 then
drink-water.applescript
display notification "Thanks. In " & ((waitTime / 60) as integer) & " minutes I'll remind you to start drinking water. Only " & (8 - waterCount) & " left!" with title "Drink Water"
drink-water.applescript
set waterCount to waterCount + 1
drink-water.applescript
if waterCount = 1 then
drink-water.applescript
set waterSuffix to "st"
drink-water.applescript
if waterCount = 2 then
drink-water.applescript
set waterSuffix to "nd"
drink-water.applescript
if waterCount = 3 then
drink-water.applescript
set waterSuffix to "rd"
drink-water.applescript
if waterCount ≥ 4 then
drink-water.applescript
set waterSuffix to "th"
drink-water.applescript
if waterCount = 8 then
drink-water.applescript
display notification "Time to drink water. This will be your last cup!" with title "Drink Water" sound name "Submarine"
drink-water.applescript
else if waterCount ≥ 9 then
drink-water.applescript
display notification "Time to drink water. This will be your " & waterCount & waterSuffix & " cup." with title "Drink Water" sound name "Submarine"
drink-water.applescript
set waitTime to 3600
drink-water.applescript
return waitTime
drink-water.applescript
property groupName : ""
Update_group_publications_from_attachment_name.applescript
property substringRegex : "(?<=\\().+?(?=\\))"
Update_group_publications_from_attachment_name.applescript
property delimiter : " "
Update_group_publications_from_attachment_name.applescript
property replaceExistingKeywords : false
Update_group_publications_from_attachment_name.applescript
property helpMessage : "For all publications in a group, this script will extract all words within the first pair of parens from the first attachment name"
Update_group_publications_from_attachment_name.applescript
property additionalInfoAppend : ", and append them to the \"Keywords\" field." -- if replaceExistingKeywords is false
Update_group_publications_from_attachment_name.applescript
property additionalInfoReplace : ", and set the \"Keywords\" field accordingly." -- if replaceExistingKeywords is true
Update_group_publications_from_attachment_name.applescript
set chosenGroupNames to my chooseGroupName()
Update_group_publications_from_attachment_name.applescript
if chosenGroupNames is false then error number -128 -- abort if user pressed "Cancel"
Update_group_publications_from_attachment_name.applescript
set groupName to first item of chosenGroupNames
Update_group_publications_from_attachment_name.applescript
set groupPubs to my publicationsForGroupByName(groupName)
Update_group_publications_from_attachment_name.applescript
if groupPubs is {} then
Update_group_publications_from_attachment_name.applescript
set theMessage to "The selected group (\"" & groupName & "\") contains no publications."
Update_group_publications_from_attachment_name.applescript
set additionalInfo to "Please select a group containing the publications you'd like to process, then run this script again."
Update_group_publications_from_attachment_name.applescript
my displayMessage("No publications found!", theMessage, additionalInfo, "Try again", "com.sonnysoftware.bookends", 2)
Update_group_publications_from_attachment_name.applescript
run -- run main script handler again
Update_group_publications_from_attachment_name.applescript
repeat with aPub in groupPubs
Update_group_publications_from_attachment_name.applescript
set attachmentName to my firstAttachmentNameFromPublication(aPub)
Update_group_publications_from_attachment_name.applescript
if attachmentName is not "" then
Update_group_publications_from_attachment_name.applescript
set keywordsList to my substringsFromString(attachmentName, substringRegex, delimiter)
Update_group_publications_from_attachment_name.applescript
if keywordsList is not {} then
Update_group_publications_from_attachment_name.applescript
set success to my setKeywordsForPublication(aPub, keywordsList)
Update_group_publications_from_attachment_name.applescript
on chooseGroupName()
Update_group_publications_from_attachment_name.applescript
set userGroups to name of every group item
Update_group_publications_from_attachment_name.applescript
set additionalInfo to additionalInfoAppend
Update_group_publications_from_attachment_name.applescript
if replaceExistingKeywords then
Update_group_publications_from_attachment_name.applescript
set additionalInfo to additionalInfoReplace
Update_group_publications_from_attachment_name.applescript
set theMessage to helpMessage & additionalInfo & linefeed & linefeed & "Select group:"
Update_group_publications_from_attachment_name.applescript
set chosenGroupNames to choose from list userGroups with title "Please choose a group…" with prompt theMessage default items {groupName} OK button name "Run" cancel button name "Cancel" without multiple selections allowed and empty selection allowed
Update_group_publications_from_attachment_name.applescript
return chosenGroupNames
Update_group_publications_from_attachment_name.applescript
end chooseGroupName
Update_group_publications_from_attachment_name.applescript
on displayMessage(theTitle, theMessage, additionalInfo, buttonName, appBundleID, iconID)
Update_group_publications_from_attachment_name.applescript
if theTitle is missing value or theTitle is "" then set theTitle to "About this script"
Update_group_publications_from_attachment_name.applescript
if buttonName is missing value or buttonName is "" then set buttonName to "OK"
Update_group_publications_from_attachment_name.applescript
if iconID is not in {0, 1, 2} then set iconID to 1 -- 0: stop, 1: note, 2: caution
Update_group_publications_from_attachment_name.applescript
if additionalInfo is not missing value and additionalInfo is not "" then
Update_group_publications_from_attachment_name.applescript
set separator to ""
Update_group_publications_from_attachment_name.applescript
if theMessage is not "" then
Update_group_publications_from_attachment_name.applescript
set separator to linefeed & linefeed
Update_group_publications_from_attachment_name.applescript
set theMessage to theMessage & separator & additionalInfo
Update_group_publications_from_attachment_name.applescript
tell application id appBundleID
Update_group_publications_from_attachment_name.applescript
display dialog theMessage with title theTitle with icon iconID buttons {buttonName} default button buttonName
Update_group_publications_from_attachment_name.applescript
end displayMessage
Update_group_publications_from_attachment_name.applescript
on publicationsForGroupByName(aGroupName)
Update_group_publications_from_attachment_name.applescript
if aGroupName is missing value or aGroupName is "" then return {}
Update_group_publications_from_attachment_name.applescript
set groupPubs to {}
Update_group_publications_from_attachment_name.applescript
set matchingGroups to every group item whose name is aGroupName
Update_group_publications_from_attachment_name.applescript
if matchingGroups is not {} then
Update_group_publications_from_attachment_name.applescript
set aGroup to first item of matchingGroups
Update_group_publications_from_attachment_name.applescript
set groupPubs to publication items of aGroup
Update_group_publications_from_attachment_name.applescript