Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript for Automation
Search
Ryoichi Izumita
November 16, 2014
Programming
290
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript for Automation
NSEG 第57回勉強会 発表資料
Ryoichi Izumita
November 16, 2014
More Decks by Ryoichi Izumita
See All by Ryoichi Izumita
モバイル開発における共通性・可変性分析入門
rizumita
0
120
Flutterアプリを生成AIで生成する勘所
rizumita
0
1.6k
FlutterアプリのテストでBuilderパターンを活用しよう
rizumita
0
800
SwiftUIの大地を駆け巡るための仕組みを作る
rizumita
0
290
VIPERアーキテクチャ
rizumita
1
860
FRPを使いはじめて3年が過ぎました。
rizumita
4
1.5k
とあるプログラマのリモートワーク
rizumita
0
400
Other Decks in Programming
See All in Programming
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
930
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
最近”作らせてる” ローカルAIアプリの話
akit37
0
480
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
160
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
360
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
410
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
Railsバージョンを4倍にした話
optim
0
470
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
How to Ace a Technical Interview
jacobian
280
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
810
First, design no harm
axbom
PRO
2
1.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Art, The Web, and Tiny UX
lynnandtonic
304
22k
GitHub's CSS Performance
jonrohan
1033
470k
Google's AI Overviews - The New Search
badams
0
1.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Transcript
@rizumita JavaScript for Automation Release Notes͔Β
͡Ίʹ ❖ MacͰͷࣗಈԽεΫϦϓτݴޠAppleScript ❖ AppleScript͋·Γར༻͕͍ͬͯͳ͍ ❖ AppleScriptಛघͳߏจ ❖ Yosemite͔ΒJavaScript͕ར༻Մೳʹͳͬͨ ❖
JavaScript for AutomationͱݺΕΔ
جຊ - AppleScript tell application "Safari" set theWindow to first
window set theTab to current tab of theWindow do JavaScript "alert(document.title)" in theTab end tell
جຊ - JavaScript safari = Application('Safari') window = safari.windows[0] tab
= window.currentTab safari.doJavaScript('alert(document.title)', { in: tab })
ApplicationͷΞΫηεํ๏ Application('Safari') // ໊લ Application('com.apple.safari') // όϯυϧID Application(‘/Applications/Safari.app') // ύε
Application(763) // ϓϩηεID Application(‘eppc://127.0.0.1/Safari') // ϦϞʔτϚγʔϯ Application.currentApplication() // ΧϨϯτΞϓϦ
ྻཁૉͷΞΫηε // Index window = app.windows.at(0) window = app.windows[0] //
Name window = app.windows.byName(‘New Window’) window = app.windows[‘New Window’] // ID window = app.windows.byId(256)
ྻͷϑΟϧλϦϯά windows.whose({query})Ͱߦ͏ɻ { name: 'JavaScript for Automation' } { _match:
[ hoge.tabs[0].name, 'Apple' ] }
݅ͷࢦఆ { hoge: { filter: ‘Fuga’ } } _equals /
‘=' _contains / _beginsWith / _endsWith _greaterThan / ‘>' _greaterThanEquals / ‘>=‘ _lessThan / ‘<‘ _lessThanEquals / '<='
and or not { _and: [ { name: 'Apple' },
{ size: { '<': 20 } }, ]} _and _or _not
ΦϒδΣΫτͷ࡞ message = Mail.OutgoingMessage().make() message = Mail.OutgoingMessage({ subject: 'Hello world',
visible: true }) para = TextEdit.Paragraph({}, 'Some text')
Scripting Additions app = Application.currentApplication() app.includeStandardAdditions = true app.say('Hello world')
app.displayDialog('Please enter your email address', { withTitle: 'Email', defaultAnswer: '
[email protected]
' }) // ϝιουʹ͍ͭͯϥΠϒϥϦͷStandardAdditionsΛࢀর
JavaScriptͷؔ var safari = Application('Safari'); link = makeMarkdownLink(safari); safari.includeStandardAdditions =
true safari.setTheClipboardTo(link) function makeMarkdownLink(aSafari) { var title = aSafari.doJavaScript('document.title', { in: safari.windows[0].currentTab() }); var url = aSafari.doJavaScript('document.URL', { in: safari.windows[0].currentTab() }); return '[' + title + '](' + url + ')'; }
ࢀߟURL ❖ JavaScript for Automation Release Notes https://developer.apple.com/library/mac/ releasenotes/InterapplicationCommunication/RN- JavaScriptForAutomation/index.html