text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
assertEqual("11:01 PM", my extractTimeFromDateTimeText("Monday, October 4, 2021 at 11:01:08 PM"), "Basic")
|
date-time.applescript
|
newMethod("formatYyyyMmDd")
|
date-time.applescript
|
assertEqual("20211004", my formatYyyyMmDd(date "Monday, October 4, 2021 at 8:00:00 AM", missing value), "No Separator")
|
date-time.applescript
|
assertEqual("2021/10/04", my formatYyyyMmDd(date "Monday, October 4, 2021 at 8:00:00 AM", "/"), "With Separator")
|
date-time.applescript
|
newMethod("formatYyMmDd")
|
date-time.applescript
|
assertEqual("211004", my formatYyMmDd(date "Monday, October 4, 2021 at 8:00:00 AM", missing value), "No Separator")
|
date-time.applescript
|
newMethod("formatYyyyDdMm")
|
date-time.applescript
|
assertEqual("2022/14/06", my formatYyyyDdMm(date "Tuesday, June 14, 2022 at 8:00:00 AM", "/"), "With Separator")
|
date-time.applescript
|
newMethod("formatMmDdYyyy")
|
date-time.applescript
|
assertEqual("06-14-2022", my formatMmDdYyyy(date "Tuesday, June 14, 2022 at 8:00:00 AM", "-"), "With Separator")
|
date-time.applescript
|
log todayMinusDays(365 + 91) -- connected date
|
date-time.applescript
|
log todayMinusDays(91) -- expirydate
|
date-time.applescript
|
log todayMinusDays(2) -- expirycarrier
|
date-time.applescript
|
log isWeekday()
|
date-time.applescript
|
log isMorning()
|
date-time.applescript
|
log isWorkHour()
|
date-time.applescript
|
set logger to std's import("logger")'s new("date-time")
|
date-time.applescript
|
patternCount({sourceTEXT:"fizz,buzz", searchString:"z"})
|
patternCount copy.applescript
|
set prefs to {sourceTEXT:item 1 of prefs, searchString:item 2 of prefs, considerCase:item 3 of prefs}
|
patternCount copy.applescript
|
set prefs to {sourceTEXT:item 1 of prefs, searchString:item 2 of prefs}
|
patternCount copy.applescript
|
error "The parameter for 'patternCount()' should be a record or at least a list. Wrap the parameter(s) in curly brackets for easy upgrade to 'patternCount() version 1.2. " number 1024
|
patternCount copy.applescript
|
set searchString to searchString of prefs
|
patternCount copy.applescript
|
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text item delimiters, searchString as string}
|
patternCount copy.applescript
|
set patternCountResult to (count of (text items of sourceTEXT)) - 1
|
patternCount copy.applescript
|
return patternCountResult
|
patternCount copy.applescript
|
error "ERROR: patternCount() handler: " & errMsg number errNum
|
patternCount copy.applescript
|
open location "https://kubernetes.io/docs/search/?q=" & argv
|
k8s.applescript
|
set app_list to every application process whose name is "VLC"
|
breakaway-vlc.applescript
|
tell application "VLC" to play
|
breakaway-vlc.applescript
|
set defCalendar to "Work"
|
addEvent_Calendar.applescript
|
set theDate to short date string of (current date)
|
addEvent_Calendar.applescript
|
display dialog "Enter event name:" default answer " Appointment"
|
addEvent_Calendar.applescript
|
set eName to text returned of the result
|
addEvent_Calendar.applescript
|
display dialog "Enter event date:" default answer (theDate as text)
|
addEvent_Calendar.applescript
|
set eDate to text returned of the result
|
addEvent_Calendar.applescript
|
display dialog "Enter begin time:" default answer "1:00 pm"
|
addEvent_Calendar.applescript
|
set eTime to text returned of the result
|
addEvent_Calendar.applescript
|
set eStart to date (eDate & space & eTime)
|
addEvent_Calendar.applescript
|
set eEnd to (date (eDate & space & eTime)) + (1 * hours)
|
addEvent_Calendar.applescript
|
display dialog "Which calendar? (Home, Work, ...)" default answer defCalendar
|
addEvent_Calendar.applescript
|
set theCal to text returned of the result
|
addEvent_Calendar.applescript
|
display dialog "Display alarm how much time before?" default answer "7" buttons {"No Alarm", "hours", "days"} default button 3
|
addEvent_Calendar.applescript
|
set {text returned:theText, button returned:theButton} to the result
|
addEvent_Calendar.applescript
|
if theButton is "days" then
|
addEvent_Calendar.applescript
|
set alarmTime to (theText as number) * -60 * 24
|
addEvent_Calendar.applescript
|
set alarmTime to 0
|
addEvent_Calendar.applescript
|
if theButton is "hours" then
|
addEvent_Calendar.applescript
|
set alarmTime to (theText as number) * -60
|
addEvent_Calendar.applescript
|
set newEvent to make new event at end of events of calendar theCal with properties {summary:eName, start date:eStart, end date:eEnd}
|
addEvent_Calendar.applescript
|
if alarmTime 0 then make new sound alarm at end of sound alarms of newEvent with properties {trigger interval:alarmTime, sound name:"Basso"}
|
addEvent_Calendar.applescript
|
display dialog "Error"
|
addEvent_Calendar.applescript
|
on run {enex_path, notebook_name}
|
note_import.applescript
|
if (notebook named notebook_name) exists then
|
note_import.applescript
|
import (enex_path as POSIX file) to notebook_name
|
note_import.applescript
|
on getScreenLayout()
|
Access%20NSScreen.scpt
|
repeat with curScreen in current application's NSScreen's screens()
|
Access%20NSScreen.scpt
|
set theFrame to curScreen's frame()
|
Access%20NSScreen.scpt
|
set thisDisplay to {width:width of |size| of theFrame, height:height of |size| of theFrame, originX:x of origin of theFrame, originY:y of origin of theFrame}
|
Access%20NSScreen.scpt
|
copy thisDisplay to the end of the output
|
Access%20NSScreen.scpt
|
end getScreenLayout
|
Access%20NSScreen.scpt
|
menu_click({"Evernote", "Format", "Style", "Bigger"})
|
test menu click.applescript
|
set mail_open to false
|
open_mail.scpt
|
repeat with this_window in main windows
|
open_mail.scpt
|
if view of this_window is mail view then
|
open_mail.scpt
|
set mail_open to true
|
open_mail.scpt
|
if mail_open is false then
|
open_mail.scpt
|
make new main window
|
open_mail.scpt
|
set view of the first main window to mail view
|
open_mail.scpt
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript({accessScript:"Custom privileges...", scriptsAccess:{allowCreate:0, scriptPrivList:{{ScriptName:"------------- Database-level Comments -------------", scriptPriv:"executable only"}, {ScriptName:"[Any New Script]", scriptPriv:"executable only"}}}})
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set defaultPrefs to {accessScript:null, scriptsAccess:null}
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set scriptsPopup to pop up button "Scripts:" of window 1
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
fmGUI_Popup_SelectByCommand({objRef:scriptsPopup, objValue:accessScript of prefs, selectCommand:"contains", clickIfAlreadySet:true})
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
if accessScript of prefs begins with "Custom privileges" then
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
windowWaitUntil_FrontIS({windowName:"Custom Script Privileges"})
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set allowCreate to checkbox "Allow creation of new scripts" of window 1
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set executeCheckbox to checkbox 3 of window 1
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
fmGUI_CheckboxSet({objRef:allowCreate, objValue:allowCreate of scriptsAccess of prefs})
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
repeat with oneScriptRec in scriptPrivList of scriptsAccess of prefs
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set oneScriptRec to contents of oneScriptRec
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set oneScriptRow to (first row of table 1 of scroll area 1 of window 1 whose name of static text 1 is ScriptName of oneScriptRec)
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
select oneScriptRow
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set oneScriptInfo to name of every static text of oneScriptRow
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
if item 3 of oneScriptInfo is not equal to scriptPriv of oneScriptRec then
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
if scriptPriv of oneScriptRec is equal to "modifiable" then
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
else if scriptPriv of oneScriptRec is equal to "executable only" then
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
clickObjectByCoords(executeCheckbox)
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
else if scriptPriv of oneScriptRec is equal to "no access" then
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
error "unable to fmGUI_ManageSecurity_PrivSet_Update_AccessScript - " & errMsg number errNum
|
fmGUI_ManageSecurity_PrivSet_Update_AccessScript.applescript
|
set year_ to y
|
paste date (dd mmm yyyy).scpt
|
set mon_ to text 1 thru 3 of (a as string)
|
paste date (dd mmm yyyy).scpt
|
set day_ to d
|
paste date (dd mmm yyyy).scpt
|
set date_ to DayLeadingZero & day_ & " " & mon_ & " " & year_ as string
|
paste date (dd mmm yyyy).scpt
|
set cmd to "echo \"" & input & "\"|perl -pne \"s/.*已购([0-9]+)月([0-9]+)日(.*)次([0-9]+)车(.*)号,(.*)站([0-9]+):([0-9]+)开.*?([0-9A-Z]+).*/\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9/\"" as string
|
12306.applescript
|
set r to do shell script cmd
|
12306.applescript
|
set split_result to theSplit(r, " ")
|
12306.applescript
|
set m to item 1 of split_result
|
12306.applescript
|
set d to item 2 of split_result
|
12306.applescript
|
set train to item 3 of split_result
|
12306.applescript
|
set cart to item 4 of split_result
|
12306.applescript
|
set seat to item 5 of split_result
|
12306.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.