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 "CoreImage" | |
on getQRPayload(imagePath) | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:imagePath | |
set theCIImage to current application's CIImage's imageWithData:(theImage's TIFFRepresentation()) | |
set theDetector to my (CIDetector's detectorOfType:(my CIDetectorTypeQRCode) context:(my CIContext's context()) options:(missing value)) | |
set theFeatures to theDetector's featuresInImage:theCIImage | |
set theResult to "" |
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 "AppKit" | |
on getDataURIForImage:theNSImage | |
-- Gets the image/png data URI of an NSImage | |
set theTIFFData to theNSImage's TIFFRepresentation() | |
set theBitmap to my (NSBitmapImageRep's imageRepWithData:(theTIFFData)) | |
set thePNGData to theBitmap's representationUsingType:(my NSJPEGFileType) |properties|:(missing value) | |
return "data:" & "image/png" & ";base64," & (thePNGData's base64EncodedStringWithOptions:0) as text | |
end getDataURIForImage: |
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 "Contacts" | |
set contactStore to my CNContactStore's alloc()'s init() | |
-- All possible keys | |
set targetKeys to {my CNContactIdentifierKey, my CNContactTypeKey, my CNContactPropertyAttribute, my CNContactNamePrefixKey, my CNContactGivenNameKey, my CNContactMiddleNameKey, my CNContactFamilyNameKey, my CNContactPreviousFamilyNameKey, my CNContactNameSuffixKey, my CNContactNicknameKey, my CNContactPhoneticGivenNameKey, my CNContactPhoneticMiddleNameKey, my CNContactPhoneticFamilyNameKey, my CNContactJobTitleKey, my CNContactDepartmentNameKey, my CNContactOrganizationNameKey, my CNContactPhoneticOrganizationNameKey, my CNContactPostalAddressesKey, my CNContactEmailAddressesKey, my CNContactUrlAddressesKey, my CNContactInstantMessageAddressesKey, my CNContactPhoneNumbersKey, my CNContactSocialProfilesKey, my CNContactBirthdayKey, my CNContactNonGregorianBirthdayKey, my CNContactDatesKey, my CNContactNoteKey, my CNContactImageDataKey, my CNContactThumbnailImageDataKey, my CNContactImageDataAvailableKey, |
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 "Foundation" | |
set theResult to "" | |
on getURLHTML(theURL) | |
global theResult | |
set theURL to current application's NSURL's URLWithString:theURL | |
set theSessionConfiguration to current application's NSURLSessionConfiguration's defaultSessionConfiguration() | |
set theSession to current application's NSURLSession's sessionWithConfiguration:(theSessionConfiguration) delegate:(me) delegateQueue:(missing value) | |
set theRequest to current application's NSURLRequest's requestWithURL:theURL | |
set theTask to theSession's dataTaskWithRequest:theRequest |
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 "CoreLocation" | |
use scripting additions | |
set theLocation to (missing value) | |
set maxSeconds to 10 | |
set timeStarted to (current date) | |
on getCurrentLocation() | |
global theLocation, maxSeconds, timeStarted | |
set locationManager to current application's CLLocationManager's alloc()'s init() |
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 "Foundation" | |
use framework "Quartz" | |
on applyComicEffect(sourcePath, destinationPath) | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:sourcePath | |
-- Set up the Filter | |
set filterName to "CIComicEffect" | |
set theFilter to current application's CIFilter's filterWithName:filterName | |
theFilter's setDefaults() |
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 "SoundAnalysis" | |
set confidenceThreshold to 0.6 -- Level of confidence necessary for classification to appear in result | |
set theResult to "" -- Sequence of sound classification labels throughout the sound file's duration | |
-- Analyze sound file for classifiable sounds | |
on analyzeSound(filePath) | |
global theResult | |
-- Initialize sound analyzer with file |
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 "Vision" | |
on getImageAnimals(imagePath) | |
-- Get image content | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:imagePath | |
-- Set up request handler using image's raw data | |
set requestHandler to current application's VNImageRequestHandler's alloc()'s initWithData:(theImage's TIFFRepresentation()) options:(current application's NSDictionary's alloc()'s init()) | |
-- Initialize text request |
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 "Vision" | |
on getImageText(imagePath) | |
-- Get image content | |
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:imagePath | |
-- Set up request handler using image's raw data | |
set requestHandler to current application's VNImageRequestHandler's alloc()'s initWithData:(theImage's TIFFRepresentation()) options:(current application's NSDictionary's alloc()'s init()) | |
-- Initialize text request |
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
{"HI95 Kauai":{"name":"HI95 Kauai","website":"http://www.hi95kauai.com/","stream":"https://pacificmedia.cdnstream1.com/2789_64.aac","genres":["hawaiian","tropical",""],"description":"","discontinued":"false"},"KPOA 93.5 FM":{"name":"KPOA 93.5 FM","website":"https://kpoa.com","stream":"https://pacificmedia.cdnstream1.com/2794_64.aac","genres":["hawaiian","tropical",""],"description":"Hawaiian Music Maui Style","discontinued":"false"},"UKULELE ISLAND":{"name":"UKULELE ISLAND","website":"http://ukulele-island.com","stream":"http://s3.voscast.com:8662/;stream1675516540823/1","genres":["ukulele","hawaiian",""],"description":"UKULELE ISLAND features artists from Hawaii and beyond.","discontinued":"false"},"Hawaiian Music Live":{"name":"Hawaiian Music Live","website":"https://www.hawaiianmusiclive.xyz","stream":"http://s6.voscast.com:10108/;","genres":["hawaiian",""],"description":"Globally engaging our communities through Live Hawaiian Music and Events","discontinued":"false"},"Hawaiian 105 - KINE":{"name":"Hawaiia |