text
stringlengths
0
15.7k
source
stringlengths
6
112
* NSData, NSJSONSerialization, NSError
README copy.md
* whereFroms - a set of handlers in an example that adds or removes the file whereFrom attribute.
README copy.md
* NSOrderedSet, NSString, NSPropertyListSerialization
README copy.md
set desiredPosition to {0.0, 0.0}
5 - 🟨🟨⬛️ … Left 2|3.scpt
set desiredSize to {0.666, 1.0}
5 - 🟨🟨⬛️ … Left 2|3.scpt
use AppleScript version "2.7"
CreateandClose.applescript
use myRemindersLib : script "StephensRemindersLib"
CreateandClose.applescript
use MarksLib : script "MarksLib"
CreateandClose.applescript
local theRemindersByID
CreateandClose.applescript
local aReminder
CreateandClose.applescript
local theReminders
CreateandClose.applescript
local theRemindersList
CreateandClose.applescript
local aReminderList
CreateandClose.applescript
local theReminderBodyFromID
CreateandClose.applescript
local theReminderBody
CreateandClose.applescript
local theFullReminder
CreateandClose.applescript
local theNewReminder
CreateandClose.applescript
set theRemindersByID to {}
CreateandClose.applescript
set aReminder to missing value
CreateandClose.applescript
set theReminders to missing value
CreateandClose.applescript
set aReminderList to missing value
CreateandClose.applescript
set theReminderBodyFromID to missing value
CreateandClose.applescript
set theReminderBody to missing value
CreateandClose.applescript
set theFullReminder to {}
CreateandClose.applescript
set theNewReminder to {}
CreateandClose.applescript
set theRemindersList to {"HPE"}
CreateandClose.applescript
set time of today to 0
CreateandClose.applescript
repeat with aReminderList in theRemindersList
CreateandClose.applescript
set theRemindersByID to myRemindersLib's getRemindersID(aReminderList, today, today, "not completed")
CreateandClose.applescript
repeat with aReminder in theRemindersByID
CreateandClose.applescript
set theReminderBodyFromID to myRemindersLib's getReminderBodyFromID(aReminderList, aReminder)
CreateandClose.applescript
if item 1 of theReminderBodyFromID is not missing value then
CreateandClose.applescript
set theReminderBody to MarksLib's split(item 1 of theReminderBodyFromID, "~")
CreateandClose.applescript
if item 1 of theReminderBody contains "Hour" then
CreateandClose.applescript
set theFullReminder to myRemindersLib's getReminderFromID(aReminderList, aReminder)
CreateandClose.applescript
tell theFullReminder
CreateandClose.applescript
copy its item 1 to the end of theNewReminder -- alldayduedate
CreateandClose.applescript
copy its item 6 to the end of theNewReminder -- due date
CreateandClose.applescript
copy its item 7 to the end of theNewReminder -- flagged
CreateandClose.applescript
copy its item 10 to the end of theNewReminder -- name
CreateandClose.applescript
copy its item 11 to the end of theNewReminder -- priority
CreateandClose.applescript
copy its item 12 to the end of theNewReminder -- remind me date
CreateandClose.applescript
doCreateNewReminder(aReminderList, theNewReminder)
CreateandClose.applescript
doCompleteReminderFromID(aReminderList, aReminder)
CreateandClose.applescript
use framework "Quartz"
ImageLib.scpt
property NSImage : class "NSImage"
ImageLib.scpt
property X_AXIS : 1
ImageLib.scpt
property Y_AXIS : 0
ImageLib.scpt
on Image(theTarget)
ImageLib.scpt
script ILImage
ImageLib.scpt
property target : theTarget
ImageLib.scpt
property width : missing value
ImageLib.scpt
property height : missing value
ImageLib.scpt
property base64data : missing value
ImageLib.scpt
property modified : false
ImageLib.scpt
on _getNSImage()
ImageLib.scpt
set _NSImage to current application's NSClassFromString("NSImage")
ImageLib.scpt
set theImage to missing value
ImageLib.scpt
if my modified is true then
ImageLib.scpt
set theImageData to current application's NSData's alloc()'s initWithBase64EncodedString:(my base64data) options:0
ImageLib.scpt
return current application's NSImage's alloc()'s initWithData:theImageData
ImageLib.scpt
if my target starts with "/" then
ImageLib.scpt
return current application's NSImage's alloc()'s initWithContentsOfFile:(my target)
ImageLib.scpt
else if my target contains ":" then
ImageLib.scpt
set theURL to current application's NSURL's URLWithString:(my target)
ImageLib.scpt
return current application's NSImage's alloc()'s initWithContentsOfURL:theURL
ImageLib.scpt
else if my target is "---" then
ImageLib.scpt
return (missing value)
ImageLib.scpt
error "Cannot create image from " & (my target)
ImageLib.scpt
end _getNSImage
ImageLib.scpt
on flip over axis
ImageLib.scpt
set theImage to my _getNSImage()
ImageLib.scpt
set flippedImage to (current application's NSImage's alloc()'s initWithSize:(theImage's |size|()))
ImageLib.scpt
flippedImage's lockFocus()
ImageLib.scpt
set transform to current application's NSAffineTransform's alloc()'s init()
ImageLib.scpt
if axis is 0 then
ImageLib.scpt
(transform's scaleXBy:-1 yBy:1)
ImageLib.scpt
(transform's translateXBy:(0 - (my width)) yBy:0)
ImageLib.scpt
else if axis is 1 then
ImageLib.scpt
(transform's scaleXBy:1 yBy:-1)
ImageLib.scpt
(transform's translateXBy:0 yBy:(0 - (my height)))
ImageLib.scpt
error "Invalid axis."
ImageLib.scpt
transform's concat()
ImageLib.scpt
set theRect to current application's NSMakeRect(0, 0, my width, my height)
ImageLib.scpt
theImage's drawInRect:theRect
ImageLib.scpt
flippedImage's unlockFocus()
ImageLib.scpt
set flippedImageData to flippedImage's TIFFRepresentation()
ImageLib.scpt
set my base64data to (flippedImageData's base64EncodedStringWithOptions:0) as string
ImageLib.scpt
set my modified to true
ImageLib.scpt
end flip
ImageLib.scpt
on rotate by degrees
ImageLib.scpt
set imageBounds to current application's NSMakeRect(0, 0, my width, my height)
ImageLib.scpt
set pathBounds to current application's NSBezierPath's bezierPathWithRect:imageBounds
ImageLib.scpt
set theTransform to current application's NSAffineTransform's transform()
ImageLib.scpt
theTransform's rotateByDegrees:-degrees
ImageLib.scpt
pathBounds's transformUsingAffineTransform:theTransform
ImageLib.scpt
set rotatedBounds to current application's NSMakeRect(0, 0, item 1 of item 2 of pathBounds's |bounds|(), item 2 of item 2 of pathBounds's |bounds|())
ImageLib.scpt
set rotatedImage to current application's NSImage's alloc()'s initWithSize:(item 2 of rotatedBounds)
ImageLib.scpt
set item 1 of imageBounds to {(current application's NSMidX(rotatedBounds)) - (current application's NSWidth(imageBounds)) / 2, (current application's NSMidY(rotatedBounds)) - (current application's NSHeight(imageBounds)) / 2}
ImageLib.scpt
set transform to current application's NSAffineTransform's transform()
ImageLib.scpt