This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use framework "EventKit" | |
set eventStore to current application's EKEventStore's alloc()'s initWithAccessToEntityTypes:(current application's EKEntityMaskReminder) | |
set calendar to current application's EKCalendar's calendarForEntityType:(current application's EKEntityTypeReminder) eventStore:eventStore | |
set calendar's title to "New List from ASObjC" | |
set calendar's source to eventStore's defaultCalendarForNewReminders's source | |
eventStore's saveCalendar:calendar commit:true |error|:(missing value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use framework "EventKit" | |
set eventStore to current application's EKEventStore's alloc()'s initWithAccessToEntityTypes:(current application's EKEntityMaskReminder) | |
set reminder to current application's EKReminder's reminderWithEventStore:eventStore | |
set reminder's title to "New Reminder from ASObjC" | |
set reminder's calendar to eventStore's defaultCalendarForNewReminders | |
eventStore's saveReminder:reminder commit:true |error|:(missing value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "CoreWLAN" | |
use framework "Foundation" | |
--SSID選択 | |
set chooseResult to choose from list my listWiFi() | |
if chooseResult = false then | |
error number -128 | |
end if | |
set networkSSID to item 1 of chooseResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use framework "CoreWLAN" | |
--Wi-Fi ON | |
my switchWiFi(true) | |
--Wi-Fi OFF | |
my switchWiFi(false) | |
on switchWiFi(onOrOff as boolean) | |
--require framework: CoreWLAN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "EventKit" | |
use framework "Foundation" | |
--Every other day | |
set recurrenceRule to my recurrenceRuleFromString("FREQ=DAILY;INTERVAL=2") | |
--> «class ocid» id «data optr00000000200393FFB97F0000» | |
my stringFromRecurrenceRule(recurrenceRule) | |
--> "FREQ=DAILY;INTERVAL=2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "AppKit" | |
use framework "Foundation" | |
my copyHTML("<p>あいうえお</p>") | |
the clipboard as record | |
(* | |
{«class HTML»:«data HTML3C703EE38182E38184E38186E38188E3818A3C2F703E», «class utf8»:"あいうえお | |
", «class RTF »:«data RTF 7B5C727466315C616E73695C616E73696370673933325C636F636F61727466313430345C636F636F617375627274663437300A7B5C666F6E7474626C5C66305C66726F6D616E5C6663686172736574302054696D65732D526F6D616E3B7D0A7B5C636F6C6F7274626C3B5C7265643235355C677265656E3235355C626C75653235353B5C726564305C677265656E305C626C7565303B7D0A5C6465667461623732300A5C706172645C7061726465667461623732305C736C3238305C73613234305C7061727469676874656E666163746F72300A0A5C66305C66733234205C636632205C6578706E64305C6578706E647477305C6B65726E696E67300A5C6F75746C305C7374726F6B65776964746830205C7374726F6B656332205C7563305C753132333534205C753132333536205C753132333538205C753132333630205C753132333632205C0A7D», «class ut16»:"あいうえお |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "AppKit" | |
my forceQuitApplication("SystemUIServer") | |
on forceQuitApplication(anApplication) | |
--require Framework: AppKit | |
tell application "System Events" | |
set bundleIdentifier to bundle identifier of my getProcess(anApplication) | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set availableFrameworks to my getEveryFramework() | |
return "return " & quote & "use framework " & character id {92, 34, 37} & "fillpopup:name=framework:default=" & my join(availableFrameworks, ":") & character id {37, 92, 34, 34} | |
on getEveryFramework() | |
--framework取得 | |
set frameworkNameList to {} | |
tell application "Finder" | |
repeat with libraryFolder in {path to library folder from system domain as alias, path to library folder from local domain as alias, path to library folder from user domain as alias} | |
if exists items of folder "Frameworks" of libraryFolder then | |
set frameworkNameList to frameworkNameList & name of items of folder "Frameworks" of libraryFolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use scripting additions | |
use framework "AppKit" | |
tell application "Safari" | |
my convertHTMLToPlainText(source of current tab of window 1) | |
end tell | |
on convertHTMLToPlainText(HTML) | |
--require framework: Foundation | |
set attributedString to my attributedStringOfHTMLText(HTML) |
NewerOlder