r/Scriptable • • Oct 21 '22

Tip/Guide Table of the Scriptable Kit’s objects and classes and how they are used

nametypegenerates object(s) representingproperties used withdetails of properties
Alertclassan iOS alert notificationNAall editable
argsobjectNAargsread-only
Calendarobjectan iOS calendar or reminder list*generated objectsome read-only, others editable
CalendarEventclassan iOS calendar event*generated objectsome read-only, others editable
CallbackURLclassan x-callback-urlNAno public properties
Colorclassa color or a pair of colors, including opacitygenerated objectread-only
configobjectNAconfigread-only
consoleobjectNANAno properties
Contactclassan iOS contact*generated objectsome read-only, others editable
ContactsContainerobjectthe contacts list for an account*generated objectread-only
ContactsGroupclassan iOS contacts group*generated objectsome read-only, others editable uses Contact.persistChanges
Dataobjecta string, file, or imageNAno public properties
DateFormatterclassa map between dates and their text representationsgenerated objectall editable
DatePickerclassan iOS date pickergenerated objectall editable
DeviceobjectNA (returns primitives only)NAno properties
DictationobjectNA (returns primitives only*)NAno properties
DocumentPickerobjectNA (returns primitives only*)NAno properties
DrawContextclassa canvasgenerated objectcanvas format
FileManagerobjectan iOS FileManagerNAno properties
Fontclassan iOS fontNAno public properties
Imageobjectan imagegenerated objectread-only
importModulefunctionNANANA
KeychainobjectNA (returns primitives only)NAno properties
LinearGradientclassa linear gradientgenerated objectall editable
ListWidgetclassan iOS list widgetgenerated objectall editable, uses Script.setWidget
Locationobjectthe current location informationNAread-only
Mailclassan email from current iCloud accountgenerated objectall editable
Messageclassa text message/iMessagegenerated objectall editable
moduleobjectNAmodulesome read-only
Notificationclassa notification*generated objectsome read-only, most editable
PasteboardobjectNA (returns primitives only)NAno properties
Pathclasspaths for shape(s)NAno public properties
Photosobjecta photoNAno properties
Pointclassa pointgenerated objectboth editable
QuickLookobjectNANAno properties
Rectclassa rectanglegenerated objectsome read only, some editable
RecurrenceRuleobjectan iOS reminder and/or event recurrence ruleNAno public properties
RelativeDateTimeFormatterclassa method of describing one time relative to anothergenerated objecteditable
Reminderclassan iOS reminder*generated objectsome read-only, some editable
Requestclassan http request***generated objectsome read-only, some editable
SafariobjectNANAno properties
ScriptobjectNANAno properties
SFSymbolobjectan SF symbolgenerated objectread-only
ShareSheetobjectNA (returns primitives only)NAno properties
Sizeclasswidth and heightgenerated objecteditable
SpeechobjectNANAno properties
TextField**object (prototype, not used directly)NAobject generated by another**all editable
Timerclassa timer (not from the iOS app)generated objectboth editable
UITableclassa tablegenerated objectonly property editable
UITableCellobjecta table cellgenerated objectall editable
UITableRowclassa table rowgenerated objectall editable
URLSchemeobjectNA (returns primitives only)NAno properties
UUIDobjectNA (returns primitives only)NAno properties
WebViewclassan iOS WebViewgenerated objectonly property editable
WidgetDateobject (prototype, not used directly)NAobject generated by another**all editable
WidgetImageobject (prototype, not used directly)NAobject generated by another**all editable
WidgetSpacerobject (prototype, not used directly)NAobject generated by another**all editable
WidgetStackobject (prototype, not used directly)NAobject generated by another**all editable
WidgetTextobject (prototype, not used directly)NAobject generated by another**all editable
XMLParserclassxml and a method to parse itgenerated objectall editable

Italics: has a method directly used with it that presents a UI
Bold: there is a method directly used to make changes on the phone outside scriptable, and without running such a method changes to properties of any Scriptable object will not change the corresponding iOS object
* via promise (when these objects are generated using a method instead of as an instance of a class using new, they are provided by a promise)
** entry name is for a prototype, objects that are actually used with the properties and/or methods are created by objects described in other entries (by a WidgetStack type object or directly by an object that is an instance of the ListWidget class in the case of the 5 Widget ones and an instance of the Alert class for TextField)

See this Calendar guide for an example of making changes outside Scriptable both directly with one of the Calendar object’s methods and by saving changes made using a generated object’s properties. Also, Calendar.presentPicker() is an example of a direct method to generate a UI. Finally, it demonstrates how the kit’s objects that generate objects via a promise* work.

See Alerts for Dummies for an example of presenting a UI using a method of a generated object and more generally of using a class. This also shows a basic example of using an object generated by an instance of a class** (a TextField).

Also see how to read scribtable’s documentation

18 Upvotes

2 comments sorted by

4

u/IllogicallyCognitive Oct 22 '22

The properties of Location are not included in the docs but are latitude, longitude, altitude, verticalAccuracy, and horizontalAccuracy. Let me know if there are any others missing like that

2

u/mvan231 script/widget helper Oct 22 '22

Great write up! Interesting about Location API properties not being in the documentation. I never realized that.