Menu

Skip to content
AppleScriptの穴
  • Home
  • Products
  • Books
  • Docs
  • Events
  • Forum
  • About This Blog
  • License
  • 仕事依頼

AppleScriptの穴

Useful & Practical AppleScript archive. Click '★Click Here to Open This Script' Link to download each AppleScript

タグ: 10.15savvy

画面上の指定座標にマウスカーソルを強制移動させてクリック

Posted on 8月 22, 2019 by Takaaki Naganoya

マウスカーソルを指定座標に強制的に移動させて、マウスクリック(プレス)を行う補助アプリケーション+呼び出しAppleScriptです。

# ご注意:マウスカーソルの移動やクリックを行うのは、本来のAppleScriptの処理ではありません
# ご注意:他のマシン上で同じ動作を再現することが(初心者には)難しいため、おすすめしません

# 本ツールはCodeSignしてMac App Storeで近日リリースする予定です

必要悪! 画面上の部品や座標をクリックする機能

マウスカーソルの強制移動とクリックは、AppleScriptではなるべく避けるべき操作ですが、ごく一部の操作を実行するため、ごくごくまれに必要になることがあります。

macOS標準装備のAppleScript専用のツール「System Events」に「click」コマンドがあり、指定のGUI部品か、あるいは画面上の座標をクリックするようになっています。

ただし、これはあくまで「指定のGUI部品や指定座標をクリックしたというメッセージ」を対象(アプリケーション)に送るというものであり、実際にマウスカーソルを移動させてクリックを実行するものではありません。

強制マウス操作ツールの歴史

それでも、アプリケーションがAppleScriptに対して機能を解放していない機能を呼び出す必要があって、かつ、メニューやボタンのクリックなどで実行できないような場合には、止むを得ず指定座標のクリックをごくまれに行うことがあります(1年に1度ぐらいの頻度)。


▲強制的にマウスカーソルを移動させてクリックする支援ツールの変遷

これまで、Framework呼び出しでこれらの動作を行ってきましたが、macOS 10.14で(SIPを解除しないかぎり)スクリプトエディタ上ではサードパーティのFrameworkを呼べなくなりました(AppleScriptドロップレット上ではバンドル内のFrameworkを呼べます)。

呼び出し側から一番簡単に利用できる方法は、指定座標のクリック機能を持つアプリケーションをXcode上でAppleScriptで作成しておき、sdefを定義して、AppleScript対応アプリケーションをAppleScriptで作るものです(豆腐をすりつぶして「ひろうす」を作るようなこの迂遠さ。Google翻訳で絶対に伝わらないニュアンス。パンをすりつぶしてパンを作るような、、、)。

そのため、いままでFrameworkで運用してきたプログラムを、アプリケーション化してsdefを付加し、スクリプタブルなバックグラウンドアプリケーション(Dockに表示されない、メニューやウィンドウが表示されない)にする必要が出てきます(まんまとAppleにタダ働きさせられているような気がするので気分はよくありませんが)。

自分ではほとんど使わないマウス強制移動&クリックツールを作ってみた

そこで、sdef(AppleScript用語辞書)をつけたライブラリやアプリケーションを作る方向で調査を行っていました。実際にパラメータの受け渡しをどのように行えるのか、どのあたりでハマるのか、どのぐらいの作業量になるのか。

その1つの到達点として、この補助アプリケーション「mouseClick」を作ってみました。バックグラウンド実行専用のため、起動してもDockにアイコンは表示されません(これを知らないユーザーがバックグラウンド起動専用のアプリケーションに、Mac App Sroreでいちゃもんをつけているのを見かけて、遠い目になりました)。

–> Download mouseClick.app (To /Applications)

※ このツールは、AppleScriptからコマンドで操作する専用のものであり、画面上には何も表示されません。

簡単なAppleScriptでマウスカーソルの移動とクリックを実行できます。初回実行時はシステム環境設定の「セキュリティとプライバシー」>「プライバシー」>「アクセシビリティ」でmouseClickに「コンピュータの制御を許可」しておく必要があります(管理者権限が必要、2回目以降は操作不要)。

forceClickでは、画面の左上を原点とした座標系を使用しています。

呼び出し側と実行側をすべてAppleScriptで組めるようになったわけで、Classic MacOS時代からこの手の「指定座標の強制クリック系ソリューション」を(止むを得ず)使ってきた身からするとなかなか感慨深いものがあります。

参考文献:
objective c 入門 CocoaアプリケーションにAppleScriptサポートを追加するにはどうすればよいですか?

AppleScript名:force click sample
tell application "mouseClick"
  force click at {4, 4} –click apple menu
end tell

★Click Here to Open This Script 

Posted in GUI Scripting list | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy | 2 Comments

checkboxLibをアップデート(2)

Posted on 8月 15, 2019 by Takaaki Naganoya

AppleScript Libraries(共有ライブラリ。以下ASLと略)にsdef(Scirpt辞書)をつけて、AppleScriptや他のOSA言語との間で共通して呼び出し可能なライブラリを書くシリーズの続きです。

単なるASLでは、AppleScript側からしか呼び出せません。そこで、sdefを書いて指定することで、より運用性を高められるのではないかと考え、実際に簡単な(素朴な内容の)ライブラリで実験してみました。

–> Download checkboxLib_v3.scptd(To ~/Library/Script Libraries)

コマンドが1つだけ。パラメータがいくつか。AppleScript側から呼び出す場合にはパラメータの省略ができるが、JXA側からは省略できないといった状態のライブラリで、普通に使っている分には問題を感じませんでした。

一方で、sdefについて調べはじめるといろいろ情報が集まってくるもので、ここ数日で急速にsdef記述のためのノウハウがたまってきました。sdefをいままでに一度も書いたことがないわけではありませんが、必要最低限の情報だけ集めて書いてオシマイという程度の「割り切った関係」というのでしょうか。それほど真剣に付き合ったことはなかったわけです。

一応、研究用にすべてのアプリケーションのsdefファイルは取り出して参照できるように収集していますが、カラスが光りものを集めて埋めておくのとほとんど差はありませんでした。HTMLに書き出したsdefについては、バージョン間の差異を検出するために有効活用していますが、sdefそのものを見せられてもあまり実用性がありませんでした。

sdefを書くことが要求仕様に出される案件がほとんどないので(1件だけあったかも)、Scripter側でも「別に普通にハンドラ呼べばいいだろ」というぐらいの認識であり、sdefを年がら年中書いているSctipterというのはほとんどいないように見えます(海外でも)。

予約語に「ゆらぎ」を許容する

いちいち予約語を正確にすべて覚えている人などいません。書いた本人ですら「こういう書き方でも認識すればいいのに」と考えがちです。そこで、入力時に別表記で入力しても、構文確認(コンパイル)時に正しい予約語に変換するSynonymを定義しておきましょう。

チェックボックスの形状を「standard」と「flat」の予約語で指定できるようにしてありますが、「standard」という予約語がすぐに思い出せないとスクリプトエディタ上で用語を確認する必要があります(そもそも、スクリプトを書くときに用語辞書を表示させないことなどないのですが)。

そこで、コマンドのパラメータ指定部分で、

<parameter name="checkbox type" type="checkbox types" code="COLC" description="checkbox type"/>

タイプに「checkbox types」を指定。この定数checkbox typesの定義部分に、同一視する単語を列挙しておきます。

<enumeration name="checkbox types" code="enu1">
	 <enumerator name="standard" code="cstd" description="Standard Checkbox">
		<synonym name="checkbox"/>
		<synonym name="normal"/>
		<synonym name="as usual"/>
</enumerator>

checkbox typeの指定パラメータ(定数)に、「checkbox」「normal」「as usual」などが書かれても、これらを「standard」と同一視して、構文確認時に「standard」に書き換えます。


▲実際にスクリプトエディタ上でSynonymが表示されている(Synと省略)

パラメータの省略許容指定(optional)

現在のバージョン(v2)のcheckboxLibでは、パラメータの省略をAppleScript側では行えます。JXAやその他のOSA言語では行えません。

パラメータを指定したくない、あるいは無指定時にはデフォルト値で処理してくれるのがベストです。逆に、省略を許容しないコマンドなんて悪夢です。

そこで、省略可能を指示する「optional」をsdefに書いてみました。

<command name="choose checkbox" code="LCCBCCKB" description="Display checkbox list with an alert dialog">
	<parameter name="main message" type="text" code="CMMS" description="Main title of an alert dialog"/>
	<parameter name="sub message" type="text" optional="yes" code="CSMS" description="Sub title of an alert dialog"/>
	<parameter name="with columns" type="integer" optional="yes" code="CSCS" description="Column number of display checkbox"/>

	<parameter name="with titles" code="COLL" description="Titles of every checkbox">
		<type type="text" list="yes"/>
            </parameter>
	<parameter name="checkbox type" type="checkbox types" optional="yes" code="COLC" description="checkbox type"/>
	<parameter name="return type" type="return types" optional="yes" code="COLR" description="return data type"/>
</command>

これで、AppleScriptからでもJXAからでも(省略可能な)パラメータを省略できるようになりました。

コマンドのパラメータで「[」「]」で囲まれているのが省略可能なものです(左:AppleScript、右:JavaScript)

AppleScript名:check box sample 4_e
— Created 2019-08-12 by Takaaki Naganoya
— 2019 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use checkLib : script "checkboxLib"

set tList to {"Carrot", "Burdock", "Radish", "Apple", "Cabbage", "Lettuce", "Potato", "Garlic", "Komatsuna", "Bok choy", "Shiitake mushroom", "Hen of the Woods"}
set cRes to choose checkbox main message "Select Vegetables" with titles tList

★Click Here to Open This Script 

JavaScript名:sample_jxa_5
// Created 2019-08-12 by Takaaki Naganoya
// 2019 Piyomaru Software
var app = Application.currentApplication()
app.includeStandardAdditions =
true
var alib = Library("checkboxLib")

var array = ["Carrot", "Burdock", "Radish", "Apple", "Cabbage", "Lettuce", "Potato", "Garlic", "komatsuna", "Bok choy", " Shiitake mushroom", "Hen of the Woods"]

alib.chooseCheckbox(
{
    mainMessage:"Select Vegetables",
    withTitles:array
  }
)

★Click Here to Open This Script 

Posted in JXA sdef | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy | 1 Comment

macOS 10.15beta関連

Posted on 8月 8, 2019 by Takaaki Naganoya

最初の10.15betaを使って3分で発覚した「aliasをposix pathに変換すると末尾がおかしくなるバグ」が修正されて一安心であるものの、Release時にさまざまなバグが再発する昨今のmacOS。

OSリリースの仕組みが会社組織的にうまく稼働していないことを感じます。とくに、CoreOSチーム。macOS 10.12でNSNotFoundの定義値を間違えたのは、間違いなくCoreOSチームなので。さらに、macOS 10.13の時にはBetaでうまく動いていたものがRelase時に動かなくなって言葉を失いました。

その後、macOS 10.13はOSごとまともに動いていなかったので(不具合に遭遇しない日はなかったので)、その反動でmacOS 10.14の自分的な評価がやたらといい今日このごろです。macOS 10.13みたいに「LAN上のファイル共有機能がいきなり効かなくなる」「日本語入力時に変換ウィンドウが消えなくなる」といった激しいバグには遭遇していません。ただ、10.13で壊滅的だったMail.appまわりのバグはいまだに信用できないので、10.14でもメールのやりとりはしないようにしています。
→ 最終バージョンの10.14.6の段階でメイン環境を移行し、目立った問題には遭遇していません

64bit Only環境の後ろ向きなメリット

各ビルドごとにmacOS 10.15 Betaのリリースノートがまとめて掲載されていますが、全体的に変更点が多くて驚かされます。

正直、macOS 10.15でこれだけOS内部のサービスやらフレームワークをいじくってしまうと、サードパーティ側がそれに追いつくのに相当の時間がかかるものと思われます。こんな大々的な変更を伴うアップデートを毎年行うべきものなのか疑問です。

ただ、64bitバイナリのみサポートするOSに移行するメリットが見えてきました。ユーザーにとって処理能力が上がるとかバッテリー寿命が伸びるとか、そうした目に見えやすいメリットではありません。

32bit版のバイナリを許容するということは、Apple側も32bit版バイナリとか32bitバイナリしか作れない古めの開発環境(互換開発環境とか?)に対応する必要があるわけで、32bitバイナリを検証し続けるほどのマンパワーがないんでしょうね。具体的にいえばCarbon系なんですが。

これまで、32bitバイナリ実行の検証に費やしていたパワーを、機能追加などに振り分けることにしたい、ということなのだと理解しました。ちなみに、2019年6月末でAppleのCarbon Dev MLが廃止になりました。MLのダウン時にはさんざん報告してもまともに対処しないくせに、こういう動きだけ素早いのはどうかと思います。

# AppleScriptの処理系はmacOS 10.7の時に64bit化されているため、64bit専用のOSになっても問題はありません。たまに間違った知識を吹聴している人がいるので念のため

BridgePlus.frameworkが(まだ)呼べない

実際に、Frameworkのバイナリ形式が変更になった(らしい)ので、macOS 10.15向けには野良Frameworkなどはビルドし直さないとダメなようです。いわく、32bitバイナリがあると文句を言われるのどうの。

目下、AppleScript関連でこの影響を最も受けているのがShane StanleyのBridgePlusライブラリ。内蔵のFrameworkをload frameworkコマンドで呼び出すと文句を言われます。

Shane次第ですが、おそらくこれはmacOS 10.15のリリースまでに解消されることでしょう(多分)。普通にXcode+10.14上でビルドしたしょーもないFrameworkが10.15上で動作(GundamのMS画像をCreateMLで学習させてZeonかEFSF所属かを判定させるFramework)しているので、それほど心配はしていません。

→ その後、Shaneからメールが来て「ちょっとこれ試してみて」と、xattrの削除を提案され、実際にやってみたらBridgePlusが動くようになりました。BridgePlusが動かなかったらけっこうきついので、一安心です

macOS 10.15 Beta5の変更点

macOS 10.15Beta5のRelease Notesに書かれている、重大な変更点が1つあります(処理系に手が加わっていないのにOS側のアップデートでいろいろ機能制限が出る今日このごろ)。

ネットワーク経由のAppleEvent実行、つまり現状ではLAN上のMac同士で、AppleScriptの常駐型のアプレットを起動して、ハンドラを一方から、あるいは相互に呼び合うことができます。いわゆるリモートAppleEventです。ここに手が加わりました。

この場合、呼ぶ側(Client)も呼ばれる側(Server)も、同じアカウントでログインしている必要がある、という変更です。この際に、「同じアカウント」というのがUser IDなのか、User名なのか、iCloud IDなのかが不明です。複数のmacOS 10.15betaマシンを用意しているわけではないのですが、物理的に可能で意味がありそうなのは同一のiCloud IDでしょうか(未検証)。

その後、macOS 10.14.6のマシン環境からRemote AppleEventsでLAN上のmacOS 10.15beta上で起動中のAppleScript Applet(常駐型)に向けてハンドラの呼び出しを行ってみたところ、同じユーザー名のアカウント同士で呼ぶことができました(使用中のiCloud IDも同じなので、何が基準なのか厳密にテストできていないんですけれども)。

AppleScript名:testRemoteEPPC
tell application "testApplet" of machine "eppc://user:xxxxxxxx@Yas-MBP.local"
  set aRes to testMe("ABCDEFG")
end tell

return aRes
–> "GFEDCBA"

★Click Here to Open This Script 

どのユーザーアカウントからのリモートAppleEvent接続でもアプリケーション(AppleScriptアプレット)が応答可能にするためには、受付側(Server)のMacでTerminalから設定コマンドを打ち込めとのこと。

defaults write /Library/Preferences/com.apple.AEServer RestrictAccessToUserSession -bool false

その後、システム環境設定の「共有」でリモートAppleEventsを禁止>許可と設定すると、他のユーザーセッションからでも制御(ハンドラ呼び出し)を受け付けるようです(未検証)。

リリースノートを一通り読んで、変更点がやたらと多いのと「罠」が多い(VPN接続時にAirDropが使用停止になる仕様など)ので、こなれるまで10.15は「待ち」だと感じています。最近のmacOSは(Beta版最終版よりも)Release時の出来がひどいので、1年かけて公式デバッグを行っているようなもの。しばらくmacOS 10.14を使い続けるのがベストでしょう。

Posted in System | Tagged 10.15savvy | Leave a comment

式評価(eval)を行う

Posted on 8月 7, 2019 by Takaaki Naganoya

文字列で与えられた計算式の評価(計算)を行うAppleScriptです。

計算式の評価(Eval)を行うといえば、AppleScriptではrun scriptで計算式の文字列を実行するとか、

set aStr to "4 + 5 – 2^3"
set aRes to run script aStr

★Click Here to Open This Script 

bcコマンドに計算を依頼するのが一般的です。

set aStr to "4 + 5 – 2^3"
set yC to string id 92
set aCMD to "echo \" scale=10; " & aStr & "\" | bc"
set aRes to do shell script aCMD

★Click Here to Open This Script 

CocoaのNSExpressionによる式評価を試してみましたが、「**」でべき乗計算を行う形式はあまり見かけないように思います。
→ 調べてみたら、他のプログラミング言語ではこっちが一般的だったので訂正(^ー^; Basic系はべき乗記号(^)でしょうか。

run scriptコマンドでAppleScriptのコマンドを実行して結果を取得できますが、ユーザーから入力させられたり他のファイルからコマンド文字列を取ってくるような仕様になっている場合には、危険なコマンドを仕込まれる危険性があるので、AppleScriptのコマンドが文字列中に入っていないかを事前にチェックするとよいと思われます。

→ 指定のAppleScriptテキストを構文確認して指定の構文要素が入っていないかチェック

AppleScript名:式評価(eval)を行う
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/08/07
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

property NSExpression : a reference to current application’s NSExpression

set aStr to "4 + 5 – 2**3"
set d1Res to calcEval(aStr) of me
–> 1.0

–式評価(Evaluate)
on calcEval(aStr)
  –https://nshipster.com/nsexpression/
  
set anExp to NSExpression’s expressionWithFormat:aStr
  
set valList to anExp’s expressionValueWithObject:(missing value) context:(missing value)
  
return valList as real
end calcEval

★Click Here to Open This Script 

Posted in Number | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSExpression | Leave a comment

標準偏差を求める v2

Posted on 8月 7, 2019 by Takaaki Naganoya

1次元配列から標準偏差を求めるAppleScriptです。

Numbersで検算してみたら結果が異なりました。元になっているSwiftのプログラムとは計算結果が合っているので、そういうこと(Cocoaの計算機能+変数型による差異)なんでしょうか。

AppleScript名:標準偏差を求める v2
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/08/07
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

property NSExpression : a reference to current application’s NSExpression
property NSMutableArray : a reference to current application’s NSMutableArray

set aList to {14.0, 37.0, 18.5, 59.0, 100}
set d1Res to calcStddev(aList) of me
–> 122.708110069451

set a2List to {1, 2, 3, 4, 4, 5, 9, 11}
set d2Res to calcStddev(a2List) of me
–> 3.218598297396

–標準偏差を計算する
on calcStddev(aList)
  –https://nshipster.com/nsexpression/
  
set anArray to NSMutableArray’s arrayWithArray:aList
  
set anExp to NSExpression’s expressionForFunction:"stddev:" arguments:{(NSExpression’s expressionForConstantValue:anArray)}
  
set valList to anExp’s expressionValueWithObject:(missing value) context:(missing value)
  
return valList as real
end calcStddev

★Click Here to Open This Script 

Posted in list Number | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSExpression NSMutableArray | Leave a comment

アラートダイアログ上にRadio Buttonを表示 v4a

Posted on 8月 7, 2019 by Takaaki Naganoya

アラートダイアログ上にRadio Buttonを表示して項目選択するAppleScriptです。

普通にラジオボタンで項目選択できるようになりました。

表示列数を指定できるようにしておきましたが、選択項目の余りが発生すると処理に矛盾が発生するため、キリのいい(割り切れる)列数を指定してください(短時間で作った試作品なので、そこまで気合は入れていません)。

AppleScript名:アラートダイアログ上にRadio Buttonを表示 v4a
— Created 2019-08-07 by Takaaki Naganoya
— 2019 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "AppKit"

property NSView : a reference to current application’s NSView
property NSAlert : a reference to current application’s NSAlert
property NSButton : a reference to current application’s NSButton
property NSRadioButton : a reference to current application’s NSRadioButton
property NSButtonTypeRadio : a reference to current application’s NSButtonTypeRadio
property NSRunningApplication : a reference to current application’s NSRunningApplication

property theResult : 0
property returnCode : 0

set paramObj to {myMessage:"Select target Item", mySubMessage:"適切なものを以下からえらんでください", myColNum:2, matrixTitleList:{"にんじん", "ごぼう", "だいこん", "りんご", "キャベツ", "レタス", "じゃがいも", "にんじん", "小松菜", "青梗菜", "しいたけ", "舞茸"}}

–my chooseItemByRadioButton:paramObj –for Debugging
my performSelectorOnMainThread:"chooseItemByRadioButton:" withObject:(paramObj) waitUntilDone:true
return (theResult as integer)

on chooseItemByRadioButton:(paramObj)
  set aMainMes to myMessage of paramObj
  
set aSubMes to mySubMessage of paramObj
  
set aMatList to (matrixTitleList of paramObj) as list
  
set aLen to length of aMatList
  
  
set colNum to (myColNum of paramObj) as integer
  
set rowNum to (aLen div colNum) + (aLen mod colNum)
  
  
set aButtonCellWidth to 150
  
set aButtonCellHeight to 24
  
  
set viewWidth to aButtonCellWidth * colNum
  
set viewHeight to aButtonCellHeight * rowNum
  
  
–define the matrix size where you’ll put the radio buttons
  
set matrixRect to current application’s NSMakeRect(0.0, 0.0, viewWidth, viewHeight)
  
set aView to NSView’s alloc()’s initWithFrame:(matrixRect)
  
  
set aCount to 1
  
set tmpArray to current application’s NSMutableArray’s new()
  
repeat with y from 1 to rowNum
    repeat with x from 1 to colNum
      if aCount ≤ aLen then
        set j to contents of item aCount of aMatList
        
set tmpB to (NSButton’s alloc()’s initWithFrame:(current application’s NSMakeRect(((x – 1) * aButtonCellWidth), ((aLen – aCount) div colNum) * aButtonCellHeight, aButtonCellWidth, aButtonCellHeight)))
        
        (
tmpB’s setTitle:j)
        (
tmpB’s setShowsBorderOnlyWhileMouseInside:true)
        (
tmpB’s setTag:(aCount))
        (
tmpB’s setTarget:me)
        (
tmpB’s setAction:("clicked:"))
        (
tmpB’s setButtonType:(current application’s NSButtonTypeRadio))
        
        (
tmpArray’s addObject:tmpB)
        
      end if
      
      
set aCount to aCount + 1
    end repeat
  end repeat
  
  
–Select the first radio button item
  (
tmpArray’s objectAtIndex:0)’s setState:(current application’s NSOnState)
  
set theResult to 1
  
  (
aView’s setSubviews:tmpArray)
  
  
— set up alert  
  
set theAlert to NSAlert’s alloc()’s init()
  
tell theAlert
    its setMessageText:aMainMes
    
its setInformativeText:aSubMes
    
its addButtonWithTitle:"OK"
    
its addButtonWithTitle:"Cancel"
    
its setAccessoryView:aView
  end tell
  
  
— show alert in modal loop
  
NSRunningApplication’s currentApplication()’s activateWithOptions:0
  
my performSelectorOnMainThread:"doModal:" withObject:(theAlert) waitUntilDone:true
  
if (my returnCode as number) = 1001 then error number -128
end chooseItemByRadioButton:

on doModal:aParam
  set (my returnCode) to aParam’s runModal()
end doModal:

on clicked:aParam
  set aTag to tag of aParam
  
set theResult to aTag
end clicked:

★Click Here to Open This Script 

Posted in dialog GUI list | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSAlert NSButton NSButtonTypeRadio NSRadioButton NSRunningApplication NSView | Leave a comment

アラートダイアログ上にRadio Buttonを表示 v3

Posted on 8月 7, 2019 by Takaaki Naganoya

アラートダイアログ上にラジオボタン的なUIを表示して選択するAppleScriptです。

–> Downdload calImageDialog (with Library within its bundle)

本当はRadio Button的なものを作りたかったのですが、NSMatrixがmacOS 10.8で非推奨というか事実上の廃止になったことを受けて、Radio Button的なものを作ってみたのですが、割と中途半端です(見た目はスゲーいいのに)。


▲macOS 10.14+Script Editor上の動き


▲macOS 10.14+Script Debugger上の動き

一応、ボタンの画像に1月分のカレンダー画像を割り当てており、機能と見た目のバランスを取ろうとしたのですが、Radio Buttonっぽい動きにはなっていません(残念!)。

あと、1年分のカレンダー画像を作成するのに不思議なぐらい時間がかかっています。

あんな素朴なcalコマンドにmacOS 10.13から当日のハイライト表示を消すための「-h」オプションが追加されていたとは、気づきませんでした。10.14で作って10.12上で動かなかったのでcalコマンドのオプションを条件分岐で変更するように初版から修正しました。

AppleScript名:アラートダイアログ上にRadio Buttonを表示 v3
— Created 2019-08-07 by Takaaki Naganoya
— 2019 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "AppKit"
use calImage : script "calImageKit"

property NSView : a reference to current application’s NSView
property NSAlert : a reference to current application’s NSAlert
property NSMatrix : a reference to current application’s NSMatrix
property NSButton : a reference to current application’s NSButton
property NSButtonCell : a reference to current application’s NSButtonCell
property NSRadioButton : a reference to current application’s NSRadioButton
property NSRadioModeMatrix : a reference to current application’s NSRadioModeMatrix
property NSRoundedBezelStyle : a reference to current application’s NSRoundedBezelStyle
property NSRunningApplication : a reference to current application’s NSRunningApplication
property NSAlertSecondButtonReturn : a reference to current application’s NSAlertSecondButtonReturn

property theResult : 0
property returnCode : 0

set paramObj to {myMessage:"Select target month", mySubMessage:"適切なものを以下からえらんでください", matrixTitleList:{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}}

–my chooseItemByRadioButton:paramObj–for Debugging

my performSelectorOnMainThread:"chooseItemByRadioButton:" withObject:paramObj waitUntilDone:true
return theResult

on chooseItemByRadioButton:paramObj
  set aMainMes to myMessage of paramObj
  
set aSubMes to mySubMessage of paramObj
  
set aMatList to (matrixTitleList of paramObj) as list
  
set aLen to length of aMatList
  
  
  
set aButtonCellWidth to 104
  
set aButtonCellHeight to 104
  
  
set colNum to 4
  
set rowNum to 3
  
  
set targYear to 2019
  
  
set viewWidth to aButtonCellWidth * colNum
  
set viewHeight to aButtonCellHeight * rowNum
  
  
–create the radio button prototype
  
set aProto to NSButtonCell’s alloc()’s init()
  
aProto’s setTitle:"Options"
  
aProto’s setButtonType:(NSRadioButton)
  
  
–define the matrix size where you’ll put the radio buttons
  
set matrixRect to current application’s NSMakeRect(0.0, 0.0, viewWidth, viewHeight)
  
set aView to NSView’s alloc()’s initWithFrame:(matrixRect)
  
  
set aCount to 1
  
set tmpArray to current application’s NSMutableArray’s new()
  
repeat with y from 1 to rowNum
    repeat with x from 1 to colNum
      set j to contents of item aCount of aMatList
      
set tmpB to (NSButton’s alloc()’s initWithFrame:(current application’s NSMakeRect(((x – 1) * aButtonCellWidth), ((aLen – aCount) div colNum) * aButtonCellHeight, aButtonCellWidth, aButtonCellHeight)))
      
–(tmpB’s setTitle:j)
      
      
set tmpImage to makeSmallCalendarImage(targYear, aCount) of calImage
      (
tmpB’s setImage:(tmpImage))
      (
tmpB’s setShowsBorderOnlyWhileMouseInside:true)
      (
tmpB’s setTag:(aCount))
      (
tmpB’s setTarget:me)
      (
tmpB’s setAction:("clicked:"))
      (
tmpB’s setButtonType:(current application’s NSButtonTypeMomentaryPushIn))
      
      (
tmpArray’s addObject:tmpB)
      
set aCount to aCount + 1
    end repeat
  end repeat
  
  (
aView’s setSubviews:tmpArray)
  
  
— set up alert  
  
set theAlert to NSAlert’s alloc()’s init()
  
tell theAlert
    its setMessageText:aMainMes
    
its setInformativeText:aSubMes
    
its addButtonWithTitle:"OK"
    
its addButtonWithTitle:"Cancel"
    
its setAccessoryView:aView
  end tell
  
  
— show alert in modal loop
  
NSRunningApplication’s currentApplication()’s activateWithOptions:0
  
my performSelectorOnMainThread:"doModal:" withObject:(theAlert) waitUntilDone:true
  
if (my returnCode as number) = 1001 then error number -128
  
end chooseItemByRadioButton:

on doModal:aParam
  set (my returnCode) to aParam’s runModal()
end doModal:

on clicked:aParam
  set aTag to tag of aParam
  
set theResult to aTag
end clicked:

★Click Here to Open This Script 

Posted in Calendar dialog GUI Image | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSAlert NSAlertSecondButtonReturn NSButton NSRoundedBezelStyle NSRunningApplication NSView | Leave a comment

アラートダイアログ上にpath control x2を表示 v2

Posted on 8月 3, 2019 by Takaaki Naganoya

アラートダイアログ上にPathcontrolを表示して、ファイルパス選択をドラッグ&ドロップで受け付けるAppleScriptの改良版です。

実行中にアピアランスのDark Mode/Light Modeへの変更が行われたときの対応を追加してみました。

実行途中でアピアランスの変更が行われると、OSが提供している部品をそのまま利用している分にはOSの管理下で色変更が行われますが、あとから色指定している部品はそのままです(↑)。上記の(↑)ように、割と違和感があるというか、実用上困る(そもそもアピアランス変更をそんな時に行う方がどうかしているとは思うのですが)ので、対処してみました。

部品はひととおり作ってあったので、組み合わせただけです。アピアランスの変更Notificationを受信する部品や、アピアランステーマを判定する部品などです。

部品の組み合わせ方にも些細なノウハウがあるので、一応やっておいたことには意義があると思っています。

AppleScript名:アラートダイアログ上にpath control x2を表示 v2
— Created 2019-08-02 by Takaaki Naganoya
— 2019 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "AppKit"

property NSView : a reference to current application’s NSView
property NSAlert : a reference to current application’s NSAlert
property NSColor : a reference to current application’s NSColor
property NSTextField : a reference to current application’s NSTextField
property NSPathControl : a reference to current application’s NSPathControl
property NSUserDefaults : a reference to current application’s NSUserDefaults
property NSRunningApplication : a reference to current application’s NSRunningApplication
property NSDistributedNotificationCenter : a reference to current application’s NSDistributedNotificationCenter

property theResult : 0
property returnCode : 0
property resList : {}
property aPathControl : missing value
property bPathControl : missing value

set paramObj to {myMessage:"ファイルの入出力フォルダ選択", mySubMessage:"どれか選択してください。", fromPathMes:"移動元:", toPathMes:"移動先:"}
my performSelectorOnMainThread:"chooseTwoPath:" withObject:paramObj waitUntilDone:true

return resList
–> {fromPathRes:"/Users/me/Desktop/keyn1.png", toPathRes:"/Users/me/Desktop/scriptmenu1.png"}

on chooseTwoPath:paramObj
  set aMainMes to myMessage of paramObj
  
set aSubMes to mySubMessage of paramObj
  
set fromLabel to fromPathMes of paramObj
  
set toLabel to toPathMes of paramObj
  
  
—Dark Mode Notification受信開始
  
NSDistributedNotificationCenter’s defaultCenter()’s addObserver:me selector:"darkModeChanged:" |name|:"AppleInterfaceThemeChangedNotification" object:(missing value)
  
  
— create a view
  
set theView to NSView’s alloc()’s initWithFrame:(current application’s NSMakeRect(0, 0, 600, 60))
  
  
— create two path control & text field
  
set aPathControl to NSPathControl’s alloc()’s initWithFrame:(current application’s NSMakeRect(100, 35, 700, 20))
  
set bPathControl to NSPathControl’s alloc()’s initWithFrame:(current application’s NSMakeRect(100, 0, 700, 20))
  
  
–Set path control’s bg colors
  
set {aCol, bCol} to pathControlSrtringColor() of me
  
aPathControl’s setBackgroundColor:(aCol)
  
bPathControl’s setBackgroundColor:(bCol)
  
  
  
set aHome to current application’s |NSURL|’s fileURLWithPath:(current application’s NSHomeDirectory()) –initial dir
  
aPathControl’s setURL:aHome
  
bPathControl’s setURL:aHome
  
  
set a1TF to NSTextField’s alloc()’s initWithFrame:(current application’s NSMakeRect(0, 35, 100, 20))
  
set a2TF to NSTextField’s alloc()’s initWithFrame:(current application’s NSMakeRect(0, 0, 100, 20))
  
a1TF’s setEditable:false
  
a2TF’s setEditable:false
  
a1TF’s setStringValue:fromLabel
  
a2TF’s setStringValue:toLabel
  
a1TF’s setDrawsBackground:false
  
a2TF’s setDrawsBackground:false
  
a1TF’s setBordered:false
  
a2TF’s setBordered:false
  
  
theView’s setSubviews:{a1TF, aPathControl, a2TF, bPathControl}
  
  
— set up alert
  
set theAlert to NSAlert’s alloc()’s init()
  
tell theAlert
    its setMessageText:aMainMes
    
its setInformativeText:aSubMes
    
its addButtonWithTitle:"OK"
    
its addButtonWithTitle:"Cancel"
    
its setAccessoryView:theView
  end tell
  
  
— show alert in modal loop
  
NSRunningApplication’s currentApplication()’s activateWithOptions:0
  
my performSelectorOnMainThread:"doModal:" withObject:(theAlert) waitUntilDone:true
  
if (my returnCode as number) = 1001 then error number -128
  
  
set s1Val to (aPathControl’s |URL|’s |path|()) as string
  
set s2Val to (bPathControl’s |URL|’s |path|()) as string
  
  
set resList to {fromPathRes:s1Val, toPathRes:s2Val}
  
  
–Notification受信停止
  
NSDistributedNotificationCenter’s defaultCenter()’s removeObserver:me |name|:"AppleInterfaceThemeChangedNotification" object:(missing value)
end chooseTwoPath:

on doModal:aParam
  set (my returnCode) to aParam’s runModal()
end doModal:

–ダークモードの判定。ダークモード時:true、ライトモード時:falseが返る
on retLIghtOrDark()
  set curMode to (NSUserDefaults’s standardUserDefaults()’s stringForKey:"AppleInterfaceStyle") as string
  
return (curMode = "Dark") as boolean
end retLIghtOrDark

–aMaxValを最大値とする数値でNSColorを作成して返す
on makeNSColorFromRGBAval(redValue as integer, greenValue as integer, blueValue as integer, alphaValue as integer, aMaxVal as integer)
  set aRedCocoa to (redValue / aMaxVal) as real
  
set aGreenCocoa to (greenValue / aMaxVal) as real
  
set aBlueCocoa to (blueValue / aMaxVal) as real
  
set aAlphaCocoa to (alphaValue / aMaxVal) as real
  
set aColor to NSColor’s colorWithCalibratedRed:aRedCocoa green:aGreenCocoa blue:aBlueCocoa alpha:aAlphaCocoa
  
return aColor
end makeNSColorFromRGBAval

–Notification handler
on darkModeChanged:(aNotification)
  set {aCol, bCol} to pathControlSrtringColor() of me
  
aPathControl’s setBackgroundColor:(aCol)
  
bPathControl’s setBackgroundColor:(bCol)
end darkModeChanged:

on pathControlSrtringColor()
  set dMode to retLIghtOrDark() of me –Dark mode:true
  
if dMode = false then
    –Light Mode
    
set aCol to (NSColor’s cyanColor())
    
set bCol to (NSColor’s yellowColor())
  else
    –Dark Mode
    
set aCol to (makeNSColorFromRGBAval(0, 96, 65, 255, 255) of me)
    
set bCol to (makeNSColorFromRGBAval(93, 92, 0, 255, 255) of me)
  end if
  
  
return {aCol, bCol}
end pathControlSrtringColor

★Click Here to Open This Script 

Posted in Color dialog GUI Noification | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSAlert NSColor NSDistributedNotificationCenter NSPathControl NSRunningApplication NSTextField NSUserDefaults NSView | Leave a comment

アイテム番号リストをもとに、ヒットしなかった項目を返す

Posted on 7月 31, 2019 by Takaaki Naganoya

アイテム番号の入ったリスト(配列変数)をもとに、ヒットしなかった項目を返すというAppleScriptです。

これは、なにがしかのデータとなにがしかの書類上に配置されたデータの照合を行って、存在が確認されなかったデータの一覧を作成するために作成したものです。

存在確認といえば、たいていは「存在していたデータそのもの、あるいはデータのアイテム番号一覧」といったものを出力するようになっています。そこに、「存在が確認できなかったデータの一覧が欲しい」という要望が出てくることも、だいたいは普通の出来事です。

ただ、この手の「言語化すると大したことはないが、実施に精神的な抵抗感をおぼえる処理」といいいますか、「後片付け的な処理」というのは、書くのが面倒で後回しになりがちなものでもあります。

事実、実際に書いてみたら、、、既存のサブルーチンの組み合わせで作りましたが、1日たって見直してみると何が書いてあるのかよく思い出せないレベルです(既存のサブルーチンの組み合わせが過ぎて、意味がわかりにくいのかも)。

AppleScript名:アイテム番号リストをもとに、ヒットしなかった項目を返す.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/07/29
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—

property NSArray : a reference to current application’s NSArray
property NSMutableSet : a reference to current application’s NSMutableSet
property NSMutableArray : a reference to current application’s NSMutableArray

use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set strList to {"Apple", "Book", "Cheeze", "Dictionary", "Escalgo", "Find", "Gorila", "hook", "ink", "jet"}
set hitIDList to {1, 2, 3, 4, 6}

set bList to getUnpickedContents(hitIDList, strList) of me
–> {"Escalgo", "Gorila", "hook", "ink", "jet"}

on getUnpickedContents(aList, strList)
  set aMax to length of strList
  
set bList to getSequentialNumList(aMax) of me
  
set cList to excludeTwoList(bList, aList) of me
  
  
set anArray to NSMutableArray’s arrayWithArray:(cList)
  
set dList to (anArray’s sortedArrayUsingSelector:"compare:") as list
  
  
set eList to retConListFromItemNumList(dList, strList) of me
  
return eList
end getUnpickedContents

–アイテム項目番号が入っているリストをもとに、中身が入っているリストから項目を取り出す
on retConListFromItemNumList(dList, strList)
  set outList to {}
  
repeat with i in dList
    set aTmp to item (contents of i) of strList
    
set the end of outList to aTmp
  end repeat
  
return outList
end retConListFromItemNumList

on excludeTwoList(aList, bList)
  set aArray to NSArray’s arrayWithArray:(aList)
  
set bArray to NSArray’s arrayWithArray:(bList)
  
  
set aSet to NSMutableSet’s alloc()’s initWithArray:aArray
  
set bSet to NSMutableSet’s alloc()’s initWithArray:bArray
  
  
aSet’s minusSet:bSet –補集合
  
set resList to aSet’s allObjects() as list
  
  
return resList
end excludeTwoList

on getSequentialNumList(aMax)
  set outList to {}
  
repeat with i from 1 to aMax
    set the end of outList to i
  end repeat
  
return outList
end getSequentialNumList

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy NSArray NSMutableArray NSMutableSet | Leave a comment

メインScript側で宣言したglobal変数値をサブ側で使用する

Posted on 7月 25, 2019 by Takaaki Naganoya

バンドル形式のAppleScriptでは、バンドル内にAppleScript Libraryを入れて、Library側の機能を呼び出すことができます。呼び出される方のサブ側のAppleScript Libraryでメイン側で宣言した変数値を参照する基礎的な内容のAppleScriptです。

–> Download mainTest.scptd

基礎は大事なので、ちょっと怪しいと思ったら必要な部分だけ組み立てて動作確認を行っています。

冒頭で(暗黙のrunハンドラの前で)global宣言を行えば、サブ側でも同じ値にアクセスできることを確認しました。一度、巨大なプログラムでやらかしたことがあって、global変数はあまり使わないように自粛していたのですが、必要とあらば仕方ありません。


▲メイン側のAppleScript。バンドル形式のAppleScriptで、この中にサブのAppleScript Libraryを入れて呼び出す


▲メイン側のAppleScriptのバンドル内に、「EverythingToTextKit.scptd」(リストやレコードなどのデータなどすべてテキスト化するライブラリ)と、「sub1.scptd」(サブ側のScript)を格納している


▲サブ側のAppleScript。ただ単にメイン側と共有しているグローバル変数「aProp」の内容をテキスト化してダイアログ表示


▲メイン側のAppleScriptを実行すると、サブ側のルーチンを呼び出して実行

Posted in How To | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy | Leave a comment

与えられた1D Listのすべての順列組み合わせパターン文字列を返す

Posted on 6月 18, 2019 by Takaaki Naganoya

与えられた1次元配列のデータのすべての順列組み合わせパターンを計算し、そのとおりに配列を並べて連結した文字列を、すべての順列組み合わせパターンについて生成して返すAppleScriptです。

InDesignやIllustratorなどの書類上に元データをレイアウトした際に、複数のテキストフィールドに分解してレイアウトされていることがあります(見た目重視で)。

その分割されたテキストフィールドを元データと比較する際に、位置情報などをもとに「このあたりが一緒になってそうだ」とあたりをつけるわけですが、左→右、上→下という順序に基づいて配置されているという保証はありません。見た目やインパクト重視で、あえて順番を変えているケースも考えられます。

そこで、並び順について「考えられるかぎりの全ての順列組み合わせでつないでチェック」するという脳筋な(マッチョな)方法を考えてみたりもするわけです。実際、この手の計算にはコンピュータは実に向いている道具なので(やらない方がおかしい?)。

そんな計算を行うために作成したAppleScriptですが、意外や意外、すべての順列組み合わせパターンを計算するルーチンは作ってありませんでした。性格的に、このあたり作ってないと気がすまないと(自分でも)思うものの、これだけ数千本も数万本もAppleScriptを書いておいて、手付かずの処理があったというのは逆に掘り出し物というべきなんでしょう。

そのため、過去に作った一番近いルーチンを流用して、すべての組み合わせパターンを計算し、そのうえで「すべての要素が異なる組み合わせ」だけを抽出しています(すべての組み合わせを計算するのに、「AAAA」とか「AAGG」とかの要素が重複する項目は削除)。

元になっているルーチンは、製品コードなどの複数桁から構成され、それぞれの桁で数値の範囲が異なるという規則性を持つコードを、すべてのパターンについて生成するというものでした。割と、製品カタログ掲載データなどで「ありがち」な仕様です。最新のルーチンでは、各桁についてプロパティ「aRuleList」に、

{下限値, 上限値}

とコードの生成ルールを定義しておいて、そのルールにもとづいてすべてのパターンのコードを展開していました。

出来上がったプログラムにそれほど時間はかけていませんが、それなりの行数に(圧縮記述をせず、見やすく、高度な処理を書けば、行数が増えるのは当然のことなんですけれども)。

  「もう少しシンプルに書けそうなもんだけどー?」

という気持ちでいっぱいですが、まずは機能を実現することが重要です。

→ この処理自体を「Permutations」と呼ぶことを見つけ、MacScripter.netにそのものズバリの処理がずらずらと並んでいるのを見て脱力しました。そうかぁ、再帰で処理するのかぁ。あ、全然高速ですね。ただ、項目数を増やすとやっぱりメモリが足りなくなって、処理がきつくなるのは同様の模様で。

→ 結局、MacScripterに投稿された各種Scriptも、最終的にテキスト要素の1次元配列にデータ変換すると、本ルーチンと同じぐらいの処理時間がかかって驚きです 本ルーチン、そんなに遅くない模様(無駄に長いだけで)

AppleScript名:与えられた文字列の1D Listのすべての順列組み合わせパターン文字列を返す v2
— Created 2019-06-18 by Takaaki Naganoya
— 2019 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

script spd
  property aList : {}
  
property tmpList : {}
  
property aRuleList : {{1, 4}, {1, 4}, {1, 4}, {1, 4}} –上書きしてしまうので、この通りとはかぎらない
  
property aRuleLen : length of aRuleList
end script

set targList to {"A", "T", "G", "C"}
set aRes to retStrListInAllCombinations(targList) of me
–> {"ATGC", "ATCG", "AGTC", "AGCT", "ACTG", "ACGT", "TAGC", "TACG", "TGAC", "TGCA", "TCAG", "TCGA", "GATC", "GACT", "GTAC", "GTCA", "GCAT", "GCTA", "CATG", "CAGT", "CTAG", "CTGA", "CGAT", "CGTA"}

–与えた文字列リストを、順列組み合わせの全パターンで組み替え直して返す
on retStrListInAllCombinations(targList as list)
  
  
set aRes to retAllPatterns(targList) of me
  
–> {1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321}
  
  
–順列組み合わせデータをもとに元データをその順番に組み合わせる
  
set (tmpList of spd) to {}
  
repeat with i in aRes
    set jList to characters of (i as string)
    
    
set tmpStr to ""
    
repeat with ii in jList
      set tmpStr to tmpStr & (contents of item (ii as integer) of targList)
    end repeat
    
    
set the end of (tmpList of spd) to tmpStr
  end repeat
  
  
return (tmpList of spd)
end retStrListInAllCombinations

–与えられた要素数のリストをもとに、すべての順列組み合わせパターンを返す
on retAllPatterns(targList)
  –ルールテーブルの初期化
  
set targStrLen to length of targList
  
set (aRuleList of spd) to {}
  
repeat with i from 1 to targStrLen
    set the end of (aRuleList of spd) to {1, targStrLen}
  end repeat
  
set (aRuleLen of spd) to targStrLen –初版ではここを更新していなかったので、データの桁数を増やしても出力結果の桁数が変わらないというバグがあった
  
  
—
  
set (aList of spd) to {} –initilaize
  
set initNum to getMinNum() of me –本ルール下における最小値
  
  
copy initNum to aNum
  
  
repeat
    set aRes to incDigit(aNum, 1) of me
    
    
if aRes = false then
      exit repeat
    end if
    
    
if (chkEachDigitIsNotSameChar(aRes) of me) = true then
      if aRes is not in (aList of spd) then
        set the end of (aList of spd) to aRes
      end if
    end if
    
    
copy aRes to aNum
    
  end repeat
  
  
return (aList of spd)
end retAllPatterns

–与えられたルール下における最小値をルールリストから求める
on getMinNum()
  –桁数が合っているだけのダミー数字を、適切な桁数作成する(例:11111)
  
set tmpNumStr to ""
  
repeat (aRuleLen of spd) times
    set tmpNumStr to tmpNumStr & "1"
  end repeat
  
  
set tmpNum to tmpNumStr as integer
  
  
–ルールから各桁の最小値を取り出して、各桁に設定する
  
repeat with i from 1 to (aRuleLen of spd)
    set aDigNum to item 1 of item i of (aRuleList of spd)
    
set tmpNum to setDigit(tmpNum, i, aDigNum) of me
  end repeat
  
  
return tmpNum
end getMinNum

–繰り上がり処理(再帰呼び出しで使用)
on incDigit(aNum, aDigit)
  set {thisMin, thisMax} to item ((aRuleLen of spd) – aDigit + 1) of (aRuleList of spd)
  
  
set aTarget to getDigit(aNum, aDigit) of me
  
  
if aTarget = thisMax then
    if aDigit = (aRuleLen of spd) then
      –オーバーフロー(桁あふれ)エラーを返す
      
return false
    end if
    
    
set bNum to incDigit(aNum, aDigit + 1) of me
    
    
if bNum = false then return false
    
    
set bNum to setDigit(bNum, aDigit, thisMin) of me
  else
    set aTarget to aTarget + 1
    
set bNum to setDigit(aNum, aDigit, aTarget) of me
  end if
  
  
return bNum
end incDigit

–指定数値のうち指定桁の数字を返す
on getDigit(aNum, aDigit)
  
  
set aStr to aNum as string
  
set aLen to length of aStr
  
if aLen < aDigit then
    return false –エラー
  end if
  
  
set tStr to character (aLen – aDigit + 1) of aStr
  
return tStr as integer
  
end getDigit

–指定数値のうち指定桁の数字を返す
on setDigit(aNum, aDigit, newNum)
  
  
set aStr to aNum as string
  
set aLen to length of aStr
  
if aLen < aDigit then
    return false –エラー
  end if
  
  
set aList to characters of aStr
  
  
set item (aLen – aDigit + 1) of aList to (newNum as string)
  
set aaStr to aList as string
  
  
return aaStr as integer
  
end setDigit

–与えた文字列の各キャラクタがすべて「別のもの」であるかをチェック
on chkEachDigitIsNotSameChar(aStr as string)
  set aLen to length of aStr
  
set aList to characters of aStr
  
  
set bList to {}
  
repeat with i in aList
    set j to contents of i
    
if j is not in bList then
      set the end of bList to j
    else
      return false –Some duplicated character(s) exists
    end if
  end repeat
  
return true –All Characters are different
end chkEachDigitIsNotSameChar

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy | 1 Comment

Catalyst AppでAppleScript対応

Posted on 6月 7, 2019 by Takaaki Naganoya

Can you use AppleScript in your UIKit app on macOS Catalina, by utilizing an AppKit bundle? ABSOLUTELY! No hacks required; just set up your scripting definition and handle AppleScript in your AppKit code as normal, or use AEInstallEventHandler. Catalyst apps are Mac apps pic.twitter.com/V3c2FAHfBc

— Steve Troughton-Smith (@stroughtonsmith) June 6, 2019

macOS 10.15, Catalinaで導入された、「Project Catalyst」。かつての名前は「Marzipan」。iOSアプリをmacOSなどAppleの他のOSプラットフォームに移植しやすくするためのフレームワークで、本来のMacアプリケーションとは機能差が(低い方に)生じるのではないかと懸念されていました。

実際のところ、Appleによる(iOSとの共通コードで作られたようにしか見えない)MusicやApple TVアプリケーションなどがAppleScriptに対応していることを見ても、CatalystアプリケーションでAppleScriptへの対応が容易であることが例示されたことの意義は大きいと思います(じゃあなんでPodcastアプリは対応してないんだよ、というツッコミはあるわけですが)。

Posted in sdef | Tagged 10.15savvy | Leave a comment

macOS 10.15 Beta Release Notesに将来のmacOSでPython、Ruby、Perlなどのランタイムが含まれなくなることを告知

Posted on 6月 6, 2019 by Takaaki Naganoya

https://developer.apple.com/documentation/macos_release_notes/macos_10_15_beta_release_notes

Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default.

なので、これらのツールを使って処理をしているプログラムは、インストーラーを走らせるとか、パッケージ内にこれらのツールのバイナリを同梱するといった対処が必要になるようです。

普通にhomebrewなどのパッケージマネージャで各種シェル系のプログラムをインストールすることが多いので、「わかっている人には影響はない」ものの、そういう事情がわかっていない人には影響が出そうなポリシー変更ではあります。

また、今後のmacOS環境にはこれらのツールがデフォルトではインストールされていないことを前提にAppleScriptを組む必要があるため、これらのツールを使う場合にはAppleScriptのバンドル内に入れて配布、基本的にdo shell scriptの使用を避けるといった対処が必要です(これら以外のCLIのコマンドも追加インストールにならないとは限りません)。

AppleのポリシーがGPLのポリシーと相入れないためにこうなった、と見る人も多いですが、セキュリティのレベルを上げるための言い訳ではないでしょうか。実際のところは分かりませんけれども。

ちなみに、osascript(つまりAppleScriptやJXA)、shell scriptなどのインタプリタ・コマンドは添付され続けるとのことです。

肝心のAppleScriptの処理系についてですが、Version 2.7で変更はありませんでした。ただ、バージョンが変わらないものの新たなバグが出ているので、macOS 10.13で失われまくった信頼を取り戻すためにも、バグを修正していただきたいものです(PDFkitまわりとか)。

「将来リリースされるmacOS」が指している具体的な内容が、正式リリース版のmacOS 10.15なのか、次のmacOS 10.16もしくはそれ以降のバージョンを指しているのかは不明です。

Posted in How To | Tagged 10.15savvy | Leave a comment

Apple TVアプリベータ版にAppleScript用語辞書

Posted on 6月 5, 2019 by Takaaki Naganoya

You'll be happy to know that but both Music and Apple TV apps on Catalina have Applescript dictionaries. Music even has stuff for controlling Air Play.

I'm pleasantly surprised.

— Kevin van Haaren (@kvanh) June 4, 2019


macOS 10.15, Catalina Beta 1を試用したユーザーからの報告によると、同バージョンに同梱されているApple TVアプリに旧iTunes.appのAppleScript用語辞書を元にしたと思われるAppleScript用語辞書が含まれており、AppleScriptからコントロールできるようです。

旧iTunes.appを親に持つ新アプリは「Music」「Apple TV」、そして「Podcast」の3本があるわけですが、前者2つにAppleScript用語辞書があることが確認されました。

残念ながら現時点ではPodcastアプリにAppleScript用語辞書はないようですが、今後のアップデートで状況は変わるかもしれません。

Posted in sdef | Tagged 10.15savvy Apple TV iTunes Music | Leave a comment

Musicアプリベータ版にAppleScript用語辞書

Posted on 6月 4, 2019 by Takaaki Naganoya

https://twitter.com/boyvanamstel/status/1135651562540478466

このところ、仕事で大きめのAppleScriptのシステムを組んでいるのでWWDC方面はぜんぜんキャチアップできていないのですが、iTunesがMusic、Podcast、Movieの3つのアプリに解体されるという噂が、だいたいそのとおりになったようで。

さらに、Musicアプリのベータ版にはiTunesと同じ(未確認)AppleScript用語辞書が搭載されているとか。ただし、iTunesの辞書そのままではない(比較してみると完全に同じではないらしい)点に注意が必要です。別アプリに分離されたデータとかは扱えないように(珍しくきちんと)配慮されているようです。

地味に、macOS 10.15, CatalinaでMacBook Pro 2012が切られなかったことが驚きであります。画面のコーティングが剥離してきても、ディスプレイまわりのパッキンがつぶれても、筐体裏面のゴム足が消え失せても、まだサポートが続くMacBook Pro 2012。

Posted in sdef | Tagged 10.15savvy iTunes Music | Leave a comment

easyJParse v4

Posted on 12月 14, 2018 by Takaaki Naganoya

簡易的な日本語テキストのParse(辞書なし)を行うAppleScriptです。

詳細な説明はこちら。

本バージョンでは、かっこ( “「”, “」”, “『”, “』”, “【”, “】”, “《”, “》”, “〈”, “〉”, “(”, “))で区切られた文字列を区分けしないで1かたまりで出力させたものです。

コマンド解釈用に作成した本Script、パラメーターとして区分けしてほしくない情報(フィールド情報やデータベース名など)をかたまりのまま出力する必要があって、そのように処理させてみました。

かっこがクロスしたりネスティング(入れ子)していることは検出していますが、そのまま連結せずに出力しています。

このプログラムを作ったことにより、固有名詞への対応のメドが立ちました。

前処理で何かの記号で固有名詞を囲えばいいんじゃないか、などと思っています。何を固有名詞とするか、ということになりますが、とりあえず住所録(Contacts.app)から人名(Last Name)や会社名をすべて出力させるのがよいだろうか、といったところです。

AppleScript名:easyJParse v4(かぎかっこ内の単語を1つの単語としてみなす)
— Created 2018-09-26 by Takaaki Naganoya
— Modified 2018-12-14 by Takaaki Naganoya
— 2018 Piyomaru Software
use AppleScript version "2.5" — El Capitan (10.11) or later
use framework "Foundation"
use scripting additions
use bPlus : script "BridgePlus" –https://www.macosxautomation.com/applescript/apps/BridgePlus.html

property NSArray : a reference to current application’s NSArray
property NSSortDescriptor : a reference to current application’s NSSortDescriptor

load framework
set aTargName to "曲のアーティスト名を変更"
–set aTargName to "<満喜子>さんの実家から半径300メートル以内にあるコンビニを取得"
–set aTargName to "Finderで選択中のAI書類上の「製品名」レイヤーから抜き出したコードをもとにスペック情報をGoogle Spreadsheet「製品コード表」から展開して保存。"
set aList to parseJ(aTargName, true) of me
–> {"Finder", "で", "選択", "中", "の", "AI", "書類", "上", "の", "「", "製品名", "」", "レイヤー", "から", "抜き出し", "た", "コード", "を", "もと", "に", "スペック", "情報", "を", "Google", " ", "Spreadsheet", "「", "製品コード表", "」", "から", "展開", "し", "て", "保存", "。"}
return aList

set aTargName to "私の名前は「長野谷」です。"
set aList to parseJ(aTargName, true) of me
–> {"私", "の", "名前", "は", "「", "長野谷", "」", "です", "。"}

–カッコのネスティングとクロス(エラー)については、処理せずにそのまま出力
on parseJ(aTargStr as string, pickupPhraseByBracketPair as boolean)
  copy aTargStr to tStr
  
  
set cList to characters of tStr
  
set wList to words of tStr
  
  
set cLen to length of cList
  
  
set w2List to {}
  
set w3List to {}
  
set aCount to 0
  
  
set lastPos to 0
  
  
repeat with i in wList
    set j to contents of i
    
    
using terms from scripting additions
      set anOffset to offset of j in tStr
    end using terms from
    
    
if anOffset is not equal to 1 then
      set aChar to character (lastPos + 1) of aTargStr
      
      
set the end of w3List to {wordList:aChar, characterList:{aChar}, startPos:(lastPos + 1), endPos:(lastPos + 1)}
    end if
    
    
set aLen to length of j
    
    
set w2List to w2List & (characters of j)
    
set startPointer to (anOffset + aCount)
    
set endPointer to (anOffset + aCount + aLen – 1)
    
    
set the end of w3List to {wordList:j, characterList:(characters of j), startPos:startPointer, endPos:endPointer}
    
    
set trimStart to (anOffset + aLen)
    
    
if trimStart > (length of tStr) then
      set trimStart to 1
    end if
    
    
set tStr to text trimStart thru -1 of tStr
    
    
set aCount to aCount + anOffset + aLen – 1
    
copy endPointer to lastPos
  end repeat
  
  
–句読点など。文末の処理
  
if endPointer is not equal to cLen then
    set the end of w3List to {wordList:tStr, characterList:(characters of tStr), startPos:(lastPos + aCount), endPos:aLen}
  end if
  
  
set bArray to sortRecListByLabel((w3List), "startPos", true) of me
  
set cArray to (bArray’s valueForKeyPath:"wordList") as list
  
  
–カッコでくくった範囲を1つの塊として連結する
  
set bracketList to {"「", "」", "『", "』", "【", "】", "《", "》", "〈", "〉", "(", ")"}
  
set bList to jointItemsBetweenBrackets(cArray, bracketList) of me
  
  
return bList
end parseJ

–リストに入れたレコードを、指定の属性ラベルの値でソート
on sortRecListByLabel(aRecList as list, aLabelStr as string, ascendF as boolean)
  set aArray to NSArray’s arrayWithArray:aRecList
  
set sortDesc to NSSortDescriptor’s alloc()’s initWithKey:aLabelStr ascending:ascendF
  
set sortDescArray to NSArray’s arrayWithObject:sortDesc
  
set sortedArray to aArray’s sortedArrayUsingDescriptors:sortDescArray
  
return sortedArray
end sortRecListByLabel

on offset of bArg in anArg
  set aClass to class of anArg
  
set bClass to class of bArg
  
  
if {aClass, bClass} = {text, text} then –case 1
    return getOffset(anArg, bArg) of me
  else if {aClass, bClass} = {list, list} then –case 2 (The target case)
    return execOffsetList(bArg, anArg) of me
  else if {aClass, bClass} = {text, list} then –case 3 (Illegular case)
    return execOffsetList(bArg, {anArg}) of me
  else if {aClass, bClass} = {list, text} then –case 4 (Illegular case)
    return execOffsetList({bArg}, anArg) of me
  end if
end offset

–1D List同士のoffset演算を行うルーチンの本体
on execOffsetList(aList as list, bList as list)
  set resList to {}
  
repeat with i in aList
    set j to contents of i
    
set aCount to 1
    
    
repeat with ii in bList
      set jj to contents of ii
      
if jj = j then
        set the end of resList to aCount
        
exit repeat
      end if
      
set aCount to aCount + 1
    end repeat
  end repeat
  
  
–見つかったItem No.が連続値かどうかチェック
  
set sRes to chkSequential(resList) of me
  
if sRes = true then
    return contents of first item of resList
  else
    return false
  end if
end execOffsetList

–与えられた1D Listが連続値かどうかをチェックする
on chkSequential(aList)
  if length of aList = 1 then return true
  
if aList = {} then return false
  
  
set aFirst to first item of aList
  
set aList to rest of aList
  
  
repeat with i in aList
    set j to contents of i
    
if j is not equal to (aFirst + 1) then
      return false
    end if
    
copy j to aFirst
  end repeat
  
  
return true
end chkSequential

–テキスト同士のoffset ofを(2.5x fasterで)実行する
on getOffset(str, searchStr)
  set d to divideBy(str, searchStr)
  
if (count d) is less than 2 then return 0
  
return (length of item 1 of d) + 1
end getOffset

on divideBy(str, separator)
  set delSave to AppleScript’s text item delimiters
  
set the AppleScript’s text item delimiters to separator
  
set strItems to every text item of str
  
set the AppleScript’s text item delimiters to delSave
  
return strItems
end divideBy

–カッコでくくった範囲を1つの塊として連結する
on jointItemsBetweenBrackets(aList as list, bracketList as list)
  load framework
  
  
–リスト内のブラケット位置の検出
  
set aRes to (current application’s SMSForder’s indexesOfItems:bracketList inArray:aList inverting:false) as list
  
–> {9, 12, 15, 18, 22, 25, 27, 29}–0 based
  
  
if aRes = {} then return aList
  
  
–位置情報リストを開始位置, 終了位置のペアの2D Listに変換する
  
set cList to (current application’s SMSForder’s subarraysFrom:(aRes) groupedBy:2 |error|:(missing value)) as list
  
–> {{9, 12}, {15, 18}, {22, 25}, {27, 29}}–0 based
  
  
–カッコの位置がクロスしていないかチェック(入れ子状態はエラーになる)
  
set dRes to checkCrossRange(cList) of me
  
if dRes = false then return aList
  
  
set ccList to reverse of cList –順次、ブラケットに囲まれた要素を連結していくので、アイテム数が随時変化する。アイテム番号が狂わないよう後方から処理する必要がある。そのために、リストの要素を逆順に組み替える
  
–> {{27, 29}, {22, 25}, {15, 18}, {9, 12}}–0 based
  
  
—
  
copy aList to aaList
  
  
repeat with i in ccList
    copy i to {s2Dat, e2Dat}
    
    
set s2Dat to s2Dat + 1 –Array index conversion from 0 to 1 based
    
set e2Dat to e2Dat + 1 –Array index conversion from 0 to 1 based
    
    
set tmp1 to items 1 thru s2Dat of aaList
    
set tmp2 to (items (s2Dat + 1) thru (e2Dat – 1) of aaList) as string
    
set tmp3 to items e2Dat thru -1 of aaList
    
    
set aaList to tmp1 & tmp2 & tmp3
  end repeat
  
  
return aaList
end jointItemsBetweenBrackets

–{始点, 終点}のペアの2D Listが違いにクロスしていないかチェック
on checkCrossRange(aList as list)
  set rList to {}
  
repeat with i in aList
    copy i to {sRange, eRange}
    
set tmpRange to current application’s NSMakeRange(sRange, eRange – sRange + 1)
    
set the end of rList to tmpRange
  end repeat
  
  
repeat with ii in rList
    set jj to contents of ii
    
repeat with i in rList
      set j to contents of i
      
      
if jj is not equal to j then
        set aRes to current application’s NSIntersectionRange(jj, j)
        
        
if aRes is not equal to {location:0, |length|:0} then
          return false
        end if
      end if
      
    end repeat
  end repeat
  
  
return true
end checkCrossRange

★Click Here to Open This Script 

Posted in list Natural Language Processing Text | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy 11.0savvy | 1 Comment

画像の破損チェック v2

Posted on 2月 11, 2018 by Takaaki Naganoya
AppleScript名:画像の破損チェック v2
set theFile to choose file
set aRes to breakImageCheck(theFile) of me
–> true / false

–破損画像チェック
–(通常時:true、破損時:false が返ってくる)
–対象形式:PICT/Photoshop/BMP/QuickTime Image/GIF/JPEG/MacPaint/JPEG2/SGI/PSD/TGA/Text/PDF/PNG/TIFF
on breakImageCheck(theFile)
  try
    tell application "Image Events"
      set {theWidth, theHeight} to dimensions of image theFile
    end tell
    
return true –normal image
  on error
    return false –broken image
  end try
end breakImageCheck

★Click Here to Open This Script 

macOS 10.14、10.15向けに修正。ただし、macOS 10.15ではデフォルト設定のままだとImage Eventsがユーザーディレクトリ以下のファイルにアクセスできない状態で出荷されているため、システム環境設定の「セキュリティとプライバシー」>「セキュリティ」>「フルディスクアクセス」に登録しておく必要があります。

AppleScript名:画像の破損チェック v2b.scpt
set theFile to (choose file of type {"public.image"}) as «class furl»
set aRes to breakImageCheck(theFile) of me
–> true / false

–破損画像チェック
–(通常時:true、破損時:false が返ってくる)
–対象形式:PICT/Photoshop/BMP/QuickTime Image/GIF/JPEG/MacPaint/JPEG2/SGI/PSD/TGA/Text/PDF/PNG/TIFF
on breakImageCheck(theFile)
  try
    tell application "Image Events"
      set tmpImage to open theFile
      
set aProp to properties of tmpImage
      
close tmpImage
    end tell
    
return true –normal image
  on error
    return false –broken image
  end try
end breakImageCheck

★Click Here to Open This Script 

Posted in file Image | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy 10.15savvy Image Events | Leave a comment

10.12でプリンタ一覧の情報を取得する

Posted on 2月 6, 2018 by Takaaki Naganoya
AppleScript名:10.12でプリンタ一覧の情報を取得する
— Created 2014-11-27 by Takaaki Naganoya
— Modified 2016-02-02 by Takaaki Naganoya
— 2016 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "AppKit"

–Get Printer Names
set pArray to current application’s NSPrinter’s printerNames
set pList to pArray as list
–>  {"Canon iP110 series", "KING JIM TEPRA PRO SR3700P", "NEC MultiWriter 5750C @ MBA13", "PageSender-Fax", "PDFwriter", "PM-T960-1", "Print to VipRiser", "Print to VipRiser (CUPS-PDF)"}

–Get Printer Type (Driver Name?)
set tArray to current application’s NSPrinter’s printerTypes
set tList to tArray as list
–> {"TEPRA PRO SR3700P", "NEC MultiWriter 5750C v2.4", "Lisanet PDFwriter", "EPSON PM-T960", "Fax Printer"}

set colorPinterList to {}

repeat with i in pList
  set j to contents of i
  
  
–Is it a Printer?
  
set aPrinter to (current application’s NSPrinter’s printerWithName:j)
  
set aDesc to aPrinter’s deviceDescription
  
set aRec to aDesc as record
  
–> {NSDeviceIsPrinter:"YES"}
  
  
–Is it a Color Printer?
  
set aColor to (aPrinter’s isColor()) as boolean –isColor() deprecated? It works
  
if aColor = true then
    set the end of colorPinterList to j
  end if
  
end repeat

colorPinterList
–>  {"Canon iP110 series", "NEC MultiWriter 5750C @ MBA13", "PDFwriter", "PM-T960-1", "Print to VipRiser", "Print to VipRiser (CUPS-PDF)"}

★Click Here to Open This Script 

Posted in System | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy | Leave a comment

Post navigation

  • Newer posts

電子書籍(PDF)をオンラインストアで販売中!

Google Search

Popular posts

  • 開発機としてM2 Mac miniが来たのでガチレビュー
  • Numbersで選択範囲のセルの前後の空白を削除
  • メキシカンハットの描画
  • Pixelmator Pro v3.6.4でAppleScriptからの操作時の挙動に違和感が
  • macOS 15でも変化したText to Speech環境
  • AppleScriptによる並列処理
  • Safariで「プロファイル」機能を使うとAppleScriptの処理に影響
  • AppleScript入門③AppleScriptを使った「自動化」とは?
  • デフォルトインストールされたフォント名を取得するAppleScript
  • 【続報】macOS 15.5で特定ファイル名パターンのfileをaliasにcastすると100%クラッシュするバグ
  • macOS 15 リモートApple Eventsにバグ?
  • Script Debuggerの開発と販売が2025年に終了
  • AppleScript入門① AppleScriptってなんだろう?
  • macOS 14で変更になったOSバージョン取得APIの返り値
  • 2024年に書いた価値あるAppleScript
  • NSObjectのクラス名を取得 v2.1
  • macOS 15:スクリプトエディタのAppleScript用語辞書を確認できない
  • Pixelmator Proがv3.6.8でHDR画像をサポート
  • 有害ではなくなっていたSpaces
  • KagiのWebブラウザ、Orion

Tags

10.11savvy (1101) 10.12savvy (1242) 10.13savvy (1391) 10.14savvy (587) 10.15savvy (438) 11.0savvy (283) 12.0savvy (212) 13.0savvy (199) 14.0savvy (153) 15.0savvy (142) CotEditor (66) Finder (52) Keynote (119) NSAlert (61) NSArray (51) NSBitmapImageRep (20) NSBundle (20) NSButton (34) NSColor (53) NSDictionary (28) NSFileManager (23) NSFont (21) NSImage (41) NSJSONSerialization (21) NSMutableArray (63) NSMutableDictionary (22) NSPredicate (36) NSRunningApplication (56) NSScreen (30) NSScrollView (22) NSString (119) NSURL (98) NSURLRequest (23) NSUTF8StringEncoding (30) NSView (33) NSWorkspace (20) Numbers (76) Pages (55) Pixelmator Pro (20) Safari (44) Script Editor (27) WKUserContentController (21) WKUserScript (20) WKWebView (23) WKWebViewConfiguration (22)

カテゴリー

  • 2D Bin Packing
  • 3D
  • AirDrop
  • AirPlay
  • Animation
  • AppleScript Application on Xcode
  • Beginner
  • Benchmark
  • beta
  • Bluetooth
  • Books
  • boolean
  • bounds
  • Bug
  • Calendar
  • call by reference
  • check sum
  • Clipboard
  • Cocoa-AppleScript Applet
  • Code Sign
  • Color
  • Custom Class
  • date
  • dialog
  • diff
  • drive
  • Droplet
  • exif
  • file
  • File path
  • filter
  • folder
  • Font
  • Font
  • GAME
  • geolocation
  • GUI
  • GUI Scripting
  • Hex
  • History
  • How To
  • iCloud
  • Icon
  • Image
  • Input Method
  • Internet
  • iOS App
  • JavaScript
  • JSON
  • JXA
  • Keychain
  • Keychain
  • Language
  • Library
  • list
  • Locale
  • Localize
  • Machine Learning
  • Map
  • Markdown
  • Menu
  • Metadata
  • MIDI
  • MIME
  • Natural Language Processing
  • Network
  • news
  • Noification
  • Notarization
  • Number
  • Object control
  • OCR
  • OSA
  • parallel processing
  • PDF
  • Peripheral
  • process
  • PRODUCTS
  • QR Code
  • Raw AppleEvent Code
  • Record
  • rectangle
  • recursive call
  • regexp
  • Release
  • Remote Control
  • Require Control-Command-R to run
  • REST API
  • Review
  • RTF
  • Sandbox
  • Screen Saver
  • Script Libraries
  • sdef
  • search
  • Security
  • selection
  • shell script
  • Shortcuts Workflow
  • Sort
  • Sound
  • Spellchecker
  • Spotlight
  • SVG
  • System
  • Tag
  • Telephony
  • Text
  • Text to Speech
  • timezone
  • Tools
  • Update
  • URL
  • UTI
  • Web Contents Control
  • WiFi
  • XML
  • XML-RPC
  • イベント(Event)
  • 未分類

アーカイブ

  • 2025年7月
  • 2025年6月
  • 2025年5月
  • 2025年4月
  • 2025年3月
  • 2025年2月
  • 2025年1月
  • 2024年12月
  • 2024年11月
  • 2024年10月
  • 2024年9月
  • 2024年8月
  • 2024年7月
  • 2024年6月
  • 2024年5月
  • 2024年4月
  • 2024年3月
  • 2024年2月
  • 2024年1月
  • 2023年12月
  • 2023年11月
  • 2023年10月
  • 2023年9月
  • 2023年8月
  • 2023年7月
  • 2023年6月
  • 2023年5月
  • 2023年4月
  • 2023年3月
  • 2023年2月
  • 2023年1月
  • 2022年12月
  • 2022年11月
  • 2022年10月
  • 2022年9月
  • 2022年8月
  • 2022年7月
  • 2022年6月
  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月
  • 2018年2月

https://piyomarusoft.booth.pm/items/301502

メタ情報

  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org

Forum Posts

  • 人気のトピック
  • 返信がないトピック

メタ情報

  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org
Proudly powered by WordPress
Theme: Flint by Star Verte LLC