JavaScript for Automation

Size: px
Start display at page:

Download "JavaScript for Automation"

Transcription

1 Services #WWDC14 JavaScript for Automation Session 306 Sal Soghoian Product Manger Automation Technologies 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

2

3 Automation in Mavericks Notifications Code signing use statements Script libraries Speakable workflows

4 Automation in Yosemite Code-signed workflows Enhanced script libraries Script progress indicators Dictation commands

5 JavaScript for Automation

6 Script Editor

7

8 Slider

9 Script Slider

10 Script Slider Event Log

11

12 Compile

13 Run

14 Stop

15 Language

16

17 AppleScript

18 JavaScript

19 Language

20

21 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length

22 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length Progress Indicator Event Log // Target app "Keynote" Application("Keynote").documents.length --> 3 /* Progress: 1 of 3 */ Application("Keynote").documents[0].name() --> New Product Design.key" Application("Keynote").export([object ObjectSpecifier], {to:[object ObjectSpecifier], as:'quicktime movie }) /* Progress: 33% completed */

23 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length Progress Indicator Event Log

24 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length Progress Indicator Event Log Application("Keynote").documents[1].name() --> Wind Power.key /* Progress: 2 of 3 */ Application("Keynote").export([object ObjectSpecifier], {to:[object ObjectSpecifier], as:'quicktime movie'}) /* Progress: 66% completed */

25 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length Progress Indicator Event Log

26 Script Keynote = Application('Keynote') documents = Keynote.documents progress = $.NSProgress.currentProgress progress.totalunitcount = documents.length destinationpath = $('~/Movies').stringByExpandingTildeInPath for (i in documents) { document = documents[i] exportname = document.name().replace('.key','.m4v') document.export({ to: Path(destinationPath.js + '/' + exportname), as: 'QuickTime movie' }) progress.completedunitcount = i } progress.completedunitcount = documents.length Event Log Application("Keynote").documents[2].name() --> "Community Projects.key" Application("Keynote").export([object ObjectSpecifier], {to:[object ObjectSpecifier], as:'quicktime movie'}) /* Progress: 3 of 3 */ /* Progress: 100% completed */ // Stop targeting Result: 3

27

28

29

30 General Settings

31 Default Language

32 AppleScript

33 JavaScript

34

35 Script Menu

36 Script Menu Script Menu

37 Formatting

38 Formatting

39

40

41

42 Language

43 Language

44 Language AppleScript

45 AppleScript Language JavaScript

46 AppleScript Language JavaScript Objective-C

47

48 Model Viewer

49 Suite

50 Suite Methods

51 Methods Suite Class

52 Methods Elements Suite Class

53 Methods Elements Suite Class Properties

54 Definition Viewer

55 Class Elements Properties Methods

56

57 Script Editor

58 JavaScript for Automation David Steinberg Automation Engineer

59 JavaScript for Automation Application scripting Libraries and applets UI scripting Using system APIs

60 Automation

61 Automation Automate tasks

62 Automation Automate tasks

63 Automation Interact with applications

64 Automation Interact with applications + + +

65 Demo

66 Automation

67 Automation Cocoa Scripting

68 Automation Object Model Object Model Object Model Cocoa Scripting

69 Automation Object Model Object Model Object Model Cocoa Scripting

70 Automation Object Model Object Model Object Model Apple Events Cocoa Scripting

71 Automation Object Model Object Model Object Model Apple Events Cocoa Scripting

72 Automation AppleScript Objective-C Perl Python Object Model Object Model Object Model Apple Events Ruby Cocoa Scripting

73 Automation Object model

74 Automation Object model

75 Automation Object model application application "Mail"

76 Automation Object model application inbox inbox of application "Mail"

77 Automation Object model application inbox messages inbox of application "Mail"

78 Automation Object model application inbox messages message 1 message 2... message 2 of inbox of application "Mail"

79 JavaScript

80 JavaScript and Automation

81 JavaScript and Automation Object Model Object Model Object Model Apple Events Cocoa Scripting

82 JavaScript and Automation Object Model Object Model Object Model JavaScript Core JavaScript AE Bridge Apple Events Cocoa Scripting

83 Application Scripting

84 Application Scripting Application object

85 Application Scripting Application object Name: Application('Safari')

86 Application Scripting Application object Name: Application('Safari') Bundle ID: Application('com.apple.mail')

87 Application Scripting Application object Name: Application('Safari') Bundle ID: Application('com.apple.mail') Path: Application('/Applications/TextEdit.app')

88 Application Scripting Application object Name: Application('Safari') Bundle ID: Application('com.apple.mail') Path: Application('/Applications/TextEdit.app') Process ID: Application(763)

89 Application Scripting Application object Name: Application('Safari') Bundle ID: Application('com.apple.mail') Path: Application('/Applications/TextEdit.app') Process ID: Application(763) Current Application: Application.currentApplication()

90 Application Scripting Syntax

91 Application Scripting Syntax Properties: Safari.name

92 Application Scripting Syntax Properties: Safari.name Elements: Safari.documents[0]

93 Application Scripting Syntax Properties: Safari.name Elements: Safari.documents[0] Commands: Safari.open(...)

94 Application Scripting Syntax Properties: Safari.name Elements: Safari.documents[0] Commands: Safari.open(...) Classes: Safari.Document(...)

95 Application Scripting Getting and setting properties

96 Application Scripting Getting and setting properties Safari = Application( Safari')

97 Application Scripting Getting and setting properties Safari = Application( Safari') doc = Safari.document[0]

98 Application Scripting Getting and setting properties Safari = Application( Safari') doc = Safari.document[0] url = doc.url()

99 Application Scripting Getting and setting properties Safari = Application( Safari') doc = Safari.document[0] url = doc.url() doc.url = '

100 Application Scripting Element arrays

101 Application Scripting Element arrays Safari = Application('Safari')

102 Application Scripting Element arrays Safari = Application('Safari') window = Safari.windows[0]

103 Application Scripting Element arrays Safari = Application('Safari') window = Safari.windows[0] window = Safari.windows['Apple']

104 Application Scripting Element arrays Safari = Application('Safari') window = Safari.windows[0] window = Safari.windows['Apple'] window = Safari.windows['#412']

105 Demo

106 Application Scripting Filtering arrays

107 Application Scripting Filtering arrays Mail = Application( Mail')

108 Application Scripting Filtering arrays Mail = Application( Mail') js s = Mail.inbox.messages.whose({subject:'JavaScript'})

109 Application Scripting Sending commands

110 Application Scripting Sending commands Mail = Application('Mail')

111 Application Scripting Sending commands Mail = Application('Mail') message = Mail.inbox.messages[0]

112 Application Scripting Sending commands Mail = Application('Mail') message = Mail.inbox.messages[0] message.open()

113 Application Scripting Sending commands Mail = Application('Mail') message = Mail.inbox.messages[0] message.open() Mail.open(message)

114 Application Scripting Sending commands Mail = Application('Mail') message = Mail.inbox.messages[0] message.open() Mail.open(message) response = message.reply({ replyall: true, openingwindow: false })

115 Application Scripting Paths

116 Application Scripting Paths TextEdit = Application('TextEdit')

117 Application Scripting Paths TextEdit = Application('TextEdit') path = Path( /Users/username/Desktop/foo.rtf')

118 Application Scripting Paths TextEdit = Application('TextEdit') path = Path( /Users/username/Desktop/foo.rtf') TextEdit.open(path)

119 Application Scripting Creating objects

120 Application Scripting Creating objects TextEdit = Application( TextEdit')

121 Application Scripting Creating objects TextEdit = Application( TextEdit') doc = TextEdit.Document()

122 Application Scripting Creating objects TextEdit = Application( TextEdit') doc = TextEdit.Document() TextEdit.documents.push(doc)

123 Application Scripting Creating objects TextEdit = Application( TextEdit') doc = TextEdit.Document() TextEdit.documents.push(doc) doc.text = 'Hello world

124 Application Scripting Creating objects TextEdit = Application( TextEdit') doc = TextEdit.Document() TextEdit.documents.push(doc) doc.text = 'Hello world jsdoc = TextEdit.Document({text:'JavaScript for Automation'}) TextEdit.documents.push(jsDoc)

125 Application Scripting Standard additions

126 Application Scripting Standard additions app = Application.currentApplication()

127 Application Scripting Standard additions app = Application.currentApplication() app.includestandardadditions = true

128 Application Scripting Standard additions app = Application.currentApplication() app.includestandardadditions = true app.beep(3)

129 Application Scripting Standard additions app = Application.currentApplication() app.includestandardadditions = true app.beep(3) app.say('hello world')

130 Application Scripting Standard additions app = Application.currentApplication() app.includestandardadditions = true app.beep(3) app.say('hello world') app.displayalert('finished task')

131 Libraries

132 Libraries Home Library Script Libraries toolbox.scpt function log(message,format) { }...

133 Libraries Home Library Script Libraries toolbox.scpt function log(message,format) { }... toolbox = Library('toolbox') toolbox.log('hello world')

134 Applets

135 Applets Event handlers

136 Applets Event handlers function run() {... }

137 Applets Event handlers function run() {... } function opendocuments(docs) {... }

138 Applets Event handlers function run() {... } function opendocuments(docs) {... } function printdocuments(docs) {... }

139 Applets Event handlers function run() {... } function opendocuments(docs) {... } function printdocuments(docs) {... } function idle() {... }

140 Applets Event handlers function run() {... } function opendocuments(docs) {... } function printdocuments(docs) {... } function idle() {... } function reopen() {... }

141 Applets Event handlers function run() {... } function opendocuments(docs) {... } function printdocuments(docs) {... } function idle() {... } function reopen() {... } function quit() {... }

142 Demo

143 UI Scripting

144 UI Scripting Built on accessibility

145 UI Scripting Built on accessibility

146 UI Scripting Built on accessibility System Events

147 UI Scripting Built on accessibility UI Scripting System Events

148 UI Scripting Clicking and typing

149 UI Scripting Clicking and typing SystemEvents = Application('System Events )

150 UI Scripting Clicking and typing SystemEvents = Application('System Events ) notesui = SystemEvents.processes[ Notes']

151 UI Scripting Clicking and typing SystemEvents = Application('System Events ) notesui = SystemEvents.processes[ Notes'] notesui.windows[0].buttons[0].click()

152 UI Scripting Clicking and typing SystemEvents = Application('System Events ) notesui = SystemEvents.processes[ Notes'] notesui.windows[0].buttons[0].click() Notes = Application('Notes') Notes.activate()

153 UI Scripting Clicking and typing SystemEvents = Application('System Events ) notesui = SystemEvents.processes[ Notes'] notesui.windows[0].buttons[0].click() Notes = Application('Notes') Notes.activate() SystemEvents.keystroke('m', { }) using: 'command down'

154 Using System APIs

155 Using System APIs ObjC and $

156 Using System APIs ObjC and $ ObjC.wrap(...)

157 Using System APIs ObjC and $ ObjC.wrap(...) ObjC.unwrap(...) ObjC.deepUnwrap(...)

158 Using System APIs ObjC and $ ObjC.wrap(...) ObjC.unwrap(...) ObjC.deepUnwrap(...) ObjC.import(...)

159 Using System APIs ObjC and $ ObjC.wrap(...) ObjC.unwrap(...) ObjC.deepUnwrap(...) ObjC.import(...) $.NSString

160 Using System APIs ObjC and $ ObjC.wrap(...) ObjC.unwrap(...) ObjC.deepUnwrap(...) ObjC.import(...) $.NSString $('foo')

161 Using System APIs Calling methods

162 Using System APIs Calling methods str = [[NSString alloc] initwithutf8string: bar ]; [str writetofile:@"/tmp/foo" atomically:yes];

163 Using System APIs Calling methods str = [[NSString alloc] initwithutf8string: bar ]; [str writetofile:@"/tmp/foo" atomically:yes]; str = $.NSString.alloc.initWithUTF8String( bar') str.writetofileatomically('/tmp/foo', true)

164 Demo

165 Using System APIs Accessing properties

166 Using System APIs Accessing properties task = $.NSTask.alloc.init

167 Using System APIs Accessing properties task = $.NSTask.alloc.init task.running

168 Using System APIs Accessing properties task = $.NSTask.alloc.init task.running task.launchpath = '/bin/sleep'

169 Using System APIs Bridged nil

170 Using System APIs Bridged nil error = $()

171 Using System APIs Bridged nil error = $() doc = $.NSXMLDocument.alloc.initWithXMLStringOptionsError( xmlstring, undefined, error )

172 Using System APIs Bridged nil error = $() doc = $.NSXMLDocument.alloc.initWithXMLStringOptionsError( xmlstring, undefined, error ) if (doc.isnil()) { } $.NSLog(error.userInfo.description)

173 Using System APIs Subclassing

174 Using System APIs Subclassing ObjC.registerSubclass({ })

175 Using System APIs Subclassing ObjC.registerSubclass({ name: AppDelegate', })

176 Using System APIs Subclassing ObjC.registerSubclass({ name: AppDelegate', superclass: NSObject, })

177 Using System APIs Subclassing ObjC.registerSubclass({ name: AppDelegate', superclass: NSObject, protocols: [ NSApplicationDelegate'], })

178 Using System APIs Subclassing ObjC.registerSubclass({ name: AppDelegate', superclass: NSObject, protocols: [ NSApplicationDelegate'], properties: { window: 'id' }, })

179 Using System APIs Subclassing ObjC.registerSubclass({ name: AppDelegate', superclass: NSObject, protocols: [ NSApplicationDelegate'], properties: { window: 'id' }, methods: { 'applicationdidfinishlaunching:': { types: ['void', ['id']], implementation: function (notification) { $.NSLog('Application finished launching'); } } } })

180 Demo

181 Using System APIs Release notes

182 Using System APIs Release notes Binding C functions

183 Using System APIs Release notes Binding C functions Explicit pass-by-reference

184 Using System APIs Release notes Binding C functions Explicit pass-by-reference Passing functions as blocks

185 Where to Use It

186 JavaScript for Automation System-wide scripting

187 JavaScript for Automation System-wide scripting Script Editor

188 JavaScript for Automation System-wide scripting Script Editor Applets/Droplets

189 JavaScript for Automation System-wide scripting Script Editor Applets/Droplets Script Menu

190 JavaScript for Automation System-wide scripting Script Editor Automator Applets/Droplets Script Menu

191 JavaScript for Automation System-wide scripting Script Editor Automator Applets/Droplets Services Script Menu

192 JavaScript for Automation System-wide scripting Script Editor Automator Applets/Droplets Services Script Menu osascript

193 Demo

194 JavaScript for Automation Summary

195 JavaScript for Automation Summary Built on JavaScriptCore and OSA

196 JavaScript for Automation Summary Built on JavaScriptCore and OSA Integrated system-wide

197 JavaScript for Automation Summary Built on JavaScriptCore and OSA Integrated system-wide Offers many options for scripting

198 JavaScript for Automation Call to action

199 JavaScript for Automation Call to action Script applications

200 JavaScript for Automation Call to action Script applications Make your applications scriptable

201 JavaScript for Automation Call to action Script applications Make your applications scriptable Tell others to make their applications scriptable

202 More Information Evangelism Documentation JavaScript for Automation Release Notes Apple Developer Forums

203 Lab Automation Lab Services Lab B Friday 12:45PM

204

Introducing the Modern WebKit API

Introducing the Modern WebKit API Frameworks #WWDC14 Introducing the Modern WebKit API Session 206 Anders Carlsson Safari and WebKit Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

Accessibility on OS X

Accessibility on OS X Frameworks #WWDC14 Accessibility on OS X New Accessibility API Session 207 Patti Hoa Accessibility Engineer! Chris Dolan Accessibility Engineer 2014 Apple Inc. All rights reserved. Redistribution or public

More information

Accessibility on ios. Developing for everyone. Frameworks #WWDC14. Session 210 Clare Kasemset ios Accessibility

Accessibility on ios. Developing for everyone. Frameworks #WWDC14. Session 210 Clare Kasemset ios Accessibility Frameworks #WWDC14 Accessibility on ios Developing for everyone Session 210 Clare Kasemset ios Accessibility 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Creating Extensions for ios and OS X, Part Two

Creating Extensions for ios and OS X, Part Two Frameworks #WWDC14 Creating Extensions for ios and OS X, Part Two Architecture Session 217 Damien Sorresso Overloaded Operator 2014 Apple Inc. All rights reserved. Redistribution or public display not

More information

What s New in Testing

What s New in Testing #WWDC18 What s New in Testing Session 403 Honza Dvorsky, Xcode Engineer Ethan Vaughan, Xcode Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

AppleScript Overview

AppleScript Overview AppleScript Overview Contents Introduction to AppleScript Overview 5 Who Should Read This Document 5 Organization of This Document 6 See Also 6 About AppleScript 7 When to Use AppleScript 8 Limitations

More information

Touch Bar Fundamentals

Touch Bar Fundamentals Session App Frameworks #WWDC17 Touch Bar Fundamentals 211 Chris Dreessen John Tegtmeyer 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

Monetize and Promote Your App with iad

Monetize and Promote Your App with iad Media #WWDC15 Monetize and Promote Your App with iad From design to launch Session 503 Carol Teng Shashank Phadke 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa Music 3SI: Introduction to Audio/Multimedia App. Programming IDE (briefly) VST Plug-in Assignment 1 hints Last Week... Week #5-5/5/2006 CCRMA, Department of Music Stanford University 1 2 Today... Cocoa

More information

Using and Extending the Xcode Source Editor

Using and Extending the Xcode Source Editor Developer Tools #WWDC16 Using and Extending the Xcode Source Editor Session 414 Mike Swingler Xcode Infrastructure and Editors Chris Hanson Xcode Infrastructure and Editors 2016 Apple Inc. All rights reserved.

More information

Extending Your Apps with SiriKit

Extending Your Apps with SiriKit App Frameworks #WWDC16 Extending Your Apps with SiriKit Session 225 Vineet Khosla SiriKit Engineering Diana Huang SiriKit Engineering Scott Andrus SiriKit Engineering 2016 Apple Inc. All rights reserved.

More information

Introducing On Demand Resources

Introducing On Demand Resources App Frameworks #WWDC15 Introducing On Demand Resources An element of App Thinning Session 214 Steve Lewallen Frameworks Engineering Tony Parker Cocoa Frameworks 2015 Apple Inc. All rights reserved. Redistribution

More information

CLOCK4 TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION

CLOCK4 TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION http:clanmills.com Page 1/8 CLOCK4 TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION Life in a new programming environment has to start somewhere. Everybody knows the hello world application written in

More information

What s New in Xcode App Signing

What s New in Xcode App Signing Developer Tools #WWDC16 What s New in Xcode App Signing Developing and distributing Session 401 Joshua Pennington Tools Engineering Manager Itai Rom Tools Engineer 2016 Apple Inc. All rights reserved.

More information

Data Delivery with Drag and Drop

Data Delivery with Drag and Drop Session App Frameworks #WWDC17 Data Delivery with Drag and Drop 227 Dave Rahardja, UIKit Tanu Singhal, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Building Faster in Xcode

Building Faster in Xcode #WWDC18 Building Faster in Xcode Session 408 David Owens, Xcode Engineer Jordan Rose, Swift Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

Quick Interaction Techniques for watchos

Quick Interaction Techniques for watchos App Frameworks #WWDC16 Quick Interaction Techniques for watchos Session 211 Tom Witkin watchos Engineer Miguel Sanchez watchos Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display

More information

What s New in Notifications

What s New in Notifications System Frameworks #WWDC15 What s New in Notifications Session 720 Michele Campeotto ios Notifications Gokul Thirumalai Apple Push Notification Service 2015 Apple Inc. All rights reserved. Redistribution

More information

CLOCK TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION

CLOCK TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION http:clanmills.com Page 1/10 CLOCK TUTORIAL VERY SIMPLE HELLO WORLD COCOA APPLICATION Life in a new programming environment has to start somewhere. Everybody knows the hello world application written in

More information

What s New in CloudKit

What s New in CloudKit System Frameworks #WWDC15 What s New in CloudKit Session 704 Olivier Bonnet icloud Client Eric Krugler icloud Server 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Seamless Linking to Your App

Seamless Linking to Your App App Frameworks #WWDC15 Seamless Linking to Your App Session 509 Conrad Shultz Safari and WebKit Software Engineer Jonathan Grynspan Core Services Software Engineer 2015 Apple Inc. All rights reserved.

More information

Introducing Password AutoFill for Apps

Introducing Password AutoFill for Apps Session App Frameworks #WWDC17 Introducing Password AutoFill for Apps Reducing friction for your users 206 Ricky Mondello, ios Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display

More information

Enhancing your apps for the next dimension of touch

Enhancing your apps for the next dimension of touch App Frameworks #WWDC16 A Peek at 3D Touch Enhancing your apps for the next dimension of touch Session 228 Tyler Fox UIKit Frameworks Engineer Peter Hajas UIKit Frameworks Engineer 2016 Apple Inc. All rights

More information

User Interfaces. Lecture 15. Application Programming on Mac OS. Hamza Bennani September 4, 2018

User Interfaces. Lecture 15. Application Programming on Mac OS. Hamza Bennani September 4, 2018 User Interfaces Lecture 15 Application Programming on Mac OS Hamza Bennani hamza@hamzabennani.com September 4, 2018 Logistics Office hours: Tue/Thu, 2pm to 3pm. Office: 250 Geoff Wyvill. Acknowledgment:

More information

What s New in imessage Apps

What s New in imessage Apps Session App Frameworks #WWDC17 What s New in imessage Apps 234 Eugene Bistolas, Messages Engineer Jay Chae, Messages Engineer Stephen Lottermoser, Messages Engineer 2017 Apple Inc. All rights reserved.

More information

Principles of Programming Languages. Objective-C. Joris Kluivers

Principles of Programming Languages. Objective-C. Joris Kluivers Principles of Programming Languages Objective-C Joris Kluivers joris.kluivers@gmail.com History... 3 NeXT... 3 Language Syntax... 4 Defining a new class... 4 Object identifiers... 5 Sending messages...

More information

Content Protection for HTTP Live Streaming

Content Protection for HTTP Live Streaming Media #WWDC15 Content Protection for HTTP Live Streaming Session 502 Roger Pantos HTTP Live Streaming Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

What s New in Energy Debugging

What s New in Energy Debugging #WWDC18 What s New in Energy Debugging Phillip Azar, Apple/Battery Life David Choi, Apple/Battery Life 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

Richard Mallion. Swift for Admins #TEAMSWIFT

Richard Mallion. Swift for Admins #TEAMSWIFT Richard Mallion Swift for Admins #TEAMSWIFT Apple Introduces Swift At the WWDC 2014 Keynote, Apple introduced Swift A new modern programming language It targets the frameworks for Cocoa and Cocoa Touch

More information

WatchKit In-Depth, Part 2

WatchKit In-Depth, Part 2 App Frameworks #WWDC15 WatchKit In-Depth, Part 2 Session 208 Nathan de Vries watchos Engineer Chloe Chang watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Building Visually Rich User Experiences

Building Visually Rich User Experiences Session App Frameworks #WWDC17 Building Visually Rich User Experiences 235 Noah Witherspoon, Software Engineer Warren Moore, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or public

More information

About MSDOSX. Lecture 0

About MSDOSX. Lecture 0 About MSDOSX Lecture 0 Goal: make an app of your own design for the Mac or iphone The Plan Lectures + Labs for several weeks Project proposals (about halfway through the semester) Work on project Present

More information

New Ways to Work with Workouts

New Ways to Work with Workouts Session #WWDC18 New Ways to Work with Workouts 707 Niharika Bedekar, Fitness Software Engineer Karim Benhmida, Health Software Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display

More information

Creating Complications with ClockKit Session 209

Creating Complications with ClockKit Session 209 App Frameworks #WWDC15 Creating Complications with ClockKit Session 209 Eliza Block watchos Engineer Paul Salzman watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display

More information

Using Grouped Notifications

Using Grouped Notifications #WWDC18 Using Grouped Notifications Session 711 Michele Campeotto, ios User Notifications 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Creating Content with iad JS

Creating Content with iad JS Creating Content with iad JS Part 2 The iad JS Framework Antoine Quint iad JS Software Engineer ios Apps and Frameworks 2 Agenda Motivations and Features of iad JS Core JavaScript Enhancements Working

More information

ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility

ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility App Frameworks #WWDC15 ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

Building for Voice with Siri Shortcuts

Building for Voice with Siri Shortcuts #WWDC18 Building for Voice with Siri Shortcuts Session 214 Amit Jain, Siri Ayaka Nonaka, Siri 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Writing Energy Efficient Apps

Writing Energy Efficient Apps Session App Frameworks #WWDC17 Writing Energy Efficient Apps 238 Daniel Schucker, Software Power Engineer Prajakta Karandikar, Software Power Engineer 2017 Apple Inc. All rights reserved. Redistribution

More information

Creating Extensions for Safari

Creating Extensions for Safari Creating Extensions for Safari Part One Timothy Hatcher Safari and WebKit Engineer 2 3 HTML5 CSS3 JavaScript Native Code 4 Cross Platform Secure Crashes 5 What You ll Learn When to make a Safari Extension

More information

Introducing the Photos Frameworks

Introducing the Photos Frameworks Media #WWDC14 Introducing the Photos Frameworks Session 511 Adam Swift ios Photos Frameworks 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Adapting to the New UI of OS X Yosemite

Adapting to the New UI of OS X Yosemite Frameworks #WWDC14 Adapting to the New UI of OS X Yosemite Session 209 Mike Stern User Experience Evangelist! Rachel Goldeen Cocoa Software Engineer! Patrick Heynen Cocoa Engineering Manager 2014 Apple

More information

Implementing UI Designs in Interface Builder

Implementing UI Designs in Interface Builder Developer Tools #WWDC15 Implementing UI Designs in Interface Builder Session 407 Kevin Cathey Interface Builder Engineer Tony Ricciardi Interface Builder Engineer 2015 Apple Inc. All rights reserved. Redistribution

More information

X Review. Mac OS X Roots: NeXT. BWS Available for virtually every OS

X Review. Mac OS X Roots: NeXT. BWS Available for virtually every OS X Review Distributed window system Server is the user s Terminal Client runs the application WM Xlib Application Widget Set Xt Intrinsics Xlib Highly modular X Server (exchange WM, Widget Set) BWS Available

More information

Cross Platform Nearby Networking

Cross Platform Nearby Networking Core OS #WWDC14 Cross Platform Nearby Networking Session 709 Demijan Klinc Software Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Cocoa Touch Best Practices

Cocoa Touch Best Practices App Frameworks #WWDC15 Cocoa Touch Best Practices Session 231 Luke Hiesterman UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

CS193P - Lecture 16. iphone Application Development. Audio APIs Video Playback Displaying Web Content Settings

CS193P - Lecture 16. iphone Application Development. Audio APIs Video Playback Displaying Web Content Settings CS193P - Lecture 16 iphone Application Development Audio APIs Video Playback Displaying Web Content Settings 1 Today s Topics Audio APIs Video Playback Settings Bundles 2 Audio Playback 3 Uses for Audio

More information

Getting the Most Out of HealthKit

Getting the Most Out of HealthKit App Frameworks #WWDC16 Getting the Most Out of HealthKit What s new and best practices Session 209 Matthew Salesi ios Software Engineer Joefrey Kibuule ios Software Engineer 2016 Apple Inc. All rights

More information

Welcome to CS193E. Mac OS X Cocoa Programming. James Dempsey Paul Marcos

Welcome to CS193E. Mac OS X Cocoa Programming. James Dempsey Paul Marcos Welcome to CS193E Mac OS X Cocoa Programming James Dempsey dempsey1@stanford.edu Paul Marcos pmarcos@stanford.edu Intros James Dempsey Paul Marcos TA - David

More information

Using Doxygen to Create Xcode Documentation Sets

Using Doxygen to Create Xcode Documentation Sets Using Doxygen to Create Xcode Documentation Sets Documentation sets (doc sets) provide a convenient way for an Xcode developer to search API and conceptual documentation (including guides, tutorials, TechNotes,

More information

Creating Great App Previews

Creating Great App Previews Services #WWDC14 Creating Great App Previews Session 304 Paul Turner Sr. Operations Manager itunes Digital Supply Chain Engineering 2014 Apple Inc. All rights reserved. Redistribution or public display

More information

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer Featured #WWDC15 Building Watch Apps Session 108 Neil Desai watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda

More information

GNUstep: What is it? gnustep.org

GNUstep: What is it? gnustep.org GNUSTEP GNUstep: What is it? A powerful object-oriented development environment: A set of cross-platform libraries for developing applications (text, graphic, script, web, etc.) Development tools and applications

More information

Modern User Interaction on ios

Modern User Interaction on ios App Frameworks #WWDC17 Modern User Interaction on ios Mastering the UIKit UIGesture System Session 219 Dominik Wagner, UIKit Engineer Michael Turner, UIKit Engineer Glen Low, UIKit Engineer 2017 Apple

More information

Introduction to Cocoa Programming

Introduction to Cocoa Programming Introduction to Cocoa Programming Dr. Ken Tabb Computer Science Dept. University of Hertfordshire Agenda Brief history of Cocoa Apple s free Developer Tools - Xcode - Interface Builder Cocoa programming

More information

Creating Audio Apps for watchos

Creating Audio Apps for watchos Session #WWDC18 Creating Audio Apps for watchos 504 Neil Desai, watchos Frameworks Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support:

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support: Xcode Release Notes This document contains release notes for Xcode 5 developer preview 5. It discusses new features and issues present in Xcode 5 developer preview 5 and issues resolved from earlier Xcode

More information

Automator Programming Guide

Automator Programming Guide Automator Programming Guide Contents Introduction to Automator Programming Guide 9 Who Should Read This Document 9 Organization of This Document 9 See Also 10 Automator and the Developer 11 Constructing

More information

ios Application Development Course Details

ios Application Development Course Details ios Application Development Course Details By Besant Technologies Course Name Category Venue ios Application Development Mobile Application Development Besant Technologies No.24, Nagendra Nagar, Velachery

More information

What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson

What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson Session App Frameworks #WWDC17 What s New in MapKit 237 Fredrik Olsson 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. MKMapView.mapType.standard

More information

IPHONE DEVELOPMENT. Getting Started with the iphone SDK

IPHONE DEVELOPMENT. Getting Started with the iphone SDK IPHONE DEVELOPMENT Getting Started with the iphone SDK OBJECTIVE-C The Big Picture STRICT SUPERSET OF C The Objective C Language Any C stuff applies Standard libs are here (time, sqrt etc) The C Language

More information

Your Apps and the Future of macos Security

Your Apps and the Future of macos Security #WWDC18 Your Apps and the Future of macos Security Pierre-Olivier Martel, Security Engineering Manager Kelly Yancey, OS Security Garrett Jacobson, Trusted Execution 2018 Apple Inc. All rights reserved.

More information

Core ML in Depth. System Frameworks #WWDC17. Krishna Sridhar, Core ML Zach Nation, Core ML

Core ML in Depth. System Frameworks #WWDC17. Krishna Sridhar, Core ML Zach Nation, Core ML System Frameworks #WWDC17 Core ML in Depth Krishna Sridhar, Core ML Zach Nation, Core ML 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

SWIFT! init(title: String) { self.title = title } // required initializer w/ named parameter

SWIFT! init(title: String) { self.title = title } // required initializer w/ named parameter SWIFT! class Session { let title: String // constant non-optional field: can never be null and can never be changed var instruktør: Person? // variable optional field: null is permitted var attendees:

More information

Introduction to Siri Shortcuts

Introduction to Siri Shortcuts #WWDC8 Introduction to Siri Shortcuts Session 2 Ari Weinstein, Siri Willem Mattelaer, Siri 208 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Introduction to PyObjC

Introduction to PyObjC Author Bob Ippolito Conference Introduction to PyObjC PyCon DC, March 2005 Intended Audience Python developers using Mac OS X 10.3 or later Spies from the Linux and Win32 camps Hopefully a GNUstep porter/maintainer

More information

What s New in Core Data?

What s New in Core Data? Session App Frameworks #WWDC17 What s New in Core? Persisting since 2004 210 Melissa Turner, Core Engineer Rishi Verma, Core Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display

More information

What's New in Core Spotlight

What's New in Core Spotlight Session System Frameworks #WWDC17 What's New in Core Spotlight Search on macos and ios 231 John Hörnkvist, Spotlight Lyn Fong, Spotlight 2017 Apple Inc. All rights reserved. Redistribution or public display

More information

Overview of Interapplication Communication 1

Overview of Interapplication Communication 1 1 This chapter describes the interapplication communication (IAC) architecture for Macintosh computers, summarizes how your application can take advantage of it, and tells you where in this book to find

More information

Advanced Scrollviews and Touch Handling Techniques

Advanced Scrollviews and Touch Handling Techniques Frameworks #WWDC14 Advanced Scrollviews and Touch Handling Techniques Session 235 Josh Shaffer ios Apps and Frameworks Engineer Eliza Block ios Apps and Frameworks Engineer 2014 Apple Inc. All rights reserved.

More information

ITP 342 Mobile App Dev. Unit Testing

ITP 342 Mobile App Dev. Unit Testing ITP 342 Mobile App Dev Unit Testing Testing Xcode provides you with capabilities for extensive software testing. Testing your projects enhances robustness, reduces bugs, and speeds the acceptance of your

More information

Thread Sanitizer and Static Analysis

Thread Sanitizer and Static Analysis Developer Tools #WWDC16 Thread Sanitizer and Static Analysis Help with finding bugs in your code Session 412 Anna Zaks Manager, Program Analysis Team Devin Coughlin Engineer, Program Analysis Team 2016

More information

Mastering Drag and Drop

Mastering Drag and Drop Session App Frameworks #WWDC17 Mastering Drag and Drop 213 Tom Adriaenssen, UIKit Wenson Hsieh, WebKit Robb Böhnke, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Automatic Strong Passwords and Security Code AutoFill

Automatic Strong Passwords and Security Code AutoFill Session #WWDC18 Automatic Strong Passwords and Security Code AutoFill 204 Chelsea Pugh, ios Engineer Reza Abbasian, ios Engineer Harris Papadopoulos, ios Engineer 2018 Apple Inc. All rights reserved. Redistribution

More information

Media and Gaming Accessibility

Media and Gaming Accessibility Session System Frameworks #WWDC17 Media and Gaming Accessibility 217 Greg Hughes, Software Engineering Manager Charlotte Hill, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or public

More information

Cocoa Fundamentals Guide

Cocoa Fundamentals Guide Cocoa Fundamentals Guide General 2010-12-13 Apple Inc. 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by

More information

Managing Documents In Your ios Apps

Managing Documents In Your ios Apps Session #WWDC18 Managing Documents In Your ios Apps 216 Brandon Tennant, Software Engineer Thomas Deniau, Software Engineer Rony Fadel, Software Engineer 2018 Apple Inc. All rights reserved. Redistribution

More information

Traditional Smalltalk Playing Well With Others Performance Etoile. Pragmatic Smalltalk. David Chisnall. August 25, 2011

Traditional Smalltalk Playing Well With Others Performance Etoile. Pragmatic Smalltalk. David Chisnall. August 25, 2011 Étoilé Pragmatic Smalltalk David Chisnall August 25, 2011 Smalltalk is Awesome! Pure object-oriented system Clean, simple syntax Automatic persistence and many other great features ...but no one cares

More information

Object-Oriented Programming with Objective-C. Lecture 2

Object-Oriented Programming with Objective-C. Lecture 2 Object-Oriented Programming with Objective-C Lecture 2 Objective-C A Little History Originally designed in the 1980s as a fusion of Smalltalk and C Popularized by NeXTSTEP in 1988 (hence the ubiquitous

More information

imessage Apps and Stickers, Part 2

imessage Apps and Stickers, Part 2 App Frameworks #WWDC16 imessage Apps and Stickers, Part 2 Interactive Messages Session 224 Alex Carter Messages Engineer Stephen Lottermoser Messages Engineer 2016 Apple Inc. All rights reserved. Redistribution

More information

Xcode 6 and ios 8 What s New for Software Developers

Xcode 6 and ios 8 What s New for Software Developers Xcode 6 and ios 8 What s New for Software Developers August 2014 Norman McEntire! norman.mcentire@servin.com Slides and Video of this presentation will be posted on Tuesday Aug 26 here: http://servin.com!1

More information

Figures, Tables, and Listings

Figures, Tables, and Listings Figures, Tables, and Listings Preface About This Book xxiii Chapter 1 Introduction to Interapplication Communication 1-1 Figure 1-1 Principal methods of communication between applications 1-5 Figure 1-2

More information

Multitasking Support on the ios Platform

Multitasking Support on the ios Platform Multitasking Support on the ios Platform Priya Rajagopal Invicara (www.invicara.com) @rajagp Multitasking on ios? Multitasking allows apps to perform certain tasks in the background while you're using

More information

What s New in tvos 12

What s New in tvos 12 #WWDC18 What s New in tvos 12 Session 208 Hans Kim, tvos Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda Agenda

More information

What s New in NSCollectionView Session 225

What s New in NSCollectionView Session 225 App Frameworks #WWDC15 What s New in NSCollectionView Session 225 Troy Stephens Application Frameworks Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Localizing with Xcode 9

Localizing with Xcode 9 Session Developer Tools #WWDC17 Localizing with Xcode 9 401 Sara Radi, Software Engineer Aya Siblini, Software Engineer Chris Hanson, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution

More information

Mastering UIKit on tvos

Mastering UIKit on tvos App Frameworks #WWDC16 Mastering UIKit on tvos Session 210 Justin Voss UIKit Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

Building Apps with Dynamic Type

Building Apps with Dynamic Type Session App Frameworks #WWDC17 Building Apps with Dynamic Type 245 Clare Kasemset, Software Engineering Manager Nandini Sundar, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or

More information

What s New in TVMLKit

What s New in TVMLKit #WWDC18 What s New in TVMLKit Session 238 Jeremy Foo, tvos Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Web Inspector

More information

What s New in the LLVM Compiler. Chris Lattner LLVM Chief Architect

What s New in the LLVM Compiler. Chris Lattner LLVM Chief Architect What s New in the LLVM Compiler Chris Lattner LLVM Chief Architect 2 Apple Compiler Evolution Renovating the Apple compiler landscape Phasing out GCC-based tools Driving innovation in LLVM-based technologies

More information

Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop

Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop Bindings Example Exercise James Dempsey - WWDC Pre-Show Cocoa Workshop In this exercise you will create a basic document-based application using Cocoa Bindings. This application will allow the user to

More information

New UIKit Support for International User Interfaces

New UIKit Support for International User Interfaces App Frameworks #WWDC15 New UIKit Support for International User Interfaces Session 222 Sara Radi Internationalization Software Engineer Aaltan Ahmad Internationalization Software Engineer Paul Borokhov

More information

Engineering for Testability

Engineering for Testability Session Developer Tools #WWDC17 Engineering for Testability 414 Brian Croom, Xcode Engineer Greg Tracy, Xcode Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Enabling Your App for CarPlay

Enabling Your App for CarPlay Session App Frameworks #WWDC17 Enabling Your App for CarPlay 719 Albert Wan, CarPlay Engineering 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Localizing with Xcode 6

Localizing with Xcode 6 Tools #WWDC14 Localizing with Xcode 6 Best practices and new workflows Session 412 Zoltan Foley-Fisher Xcode Software Engineer! Chris Hanson Xcode Software Engineer 2014 Apple Inc. All rights reserved.

More information

Optimizing Swift Performance Session 409

Optimizing Swift Performance Session 409 Developer Tools #WWDC15 Optimizing Swift Performance Session 409 Nadav Rotem Manager, Swift Performance Team Michael Gottesman Engineer, Swift Performance Team Joe Grzywacz Engineer, Performance Tools

More information

What's New in UIKit Dynamics and Visual Effects Session 229

What's New in UIKit Dynamics and Visual Effects Session 229 App Frameworks #WWDC15 What's New in UIKit Dynamics and Visual Effects Session 229 Michael Turner UIKit Engineer David Duncan UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public

More information

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 Questions? Announcements Assignment #1 due this evening by 11:59pm Remember, if you wish to use a free late you must email me before

More information

These are exciting times for Macintosh users. When Apple unleashed Mac

These are exciting times for Macintosh users. When Apple unleashed Mac Chapter 1 A Brief Tour of Cocoa Development In This Chapter Programming for Mac OS X Discovering the Cocoa development process Exploring the tools for programming Cocoa applications These are exciting

More information

Integrating Apps and Content with AR Quick Look

Integrating Apps and Content with AR Quick Look Session #WWDC18 Integrating Apps and Content with AR Quick Look 603 David Lui, ARKit Engineering Dave Addey, ARKit Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not

More information