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

カテゴリー: System

InputManagerでIMを切り換える v2

Posted on 12月 20, 2018 by Takaaki Naganoya

InputManager.frameworkを呼び出して、日本語入力Input Methodの入力文字の切り替えを行うAppleScriptです。

–> Demo Movie

macOS標準装備のスクリプトエディタ上ではControl-Command-Rで実行できましたが、Script Debugger上で動かなかった(メインスレッド上で強制実行する必要があった)ので、切り替えメソッドを強制的にメインスレッド上で実行するように変更してみました。

–> InputManager.framework (To ~/Library/Frameworks)

macOS 10.14上で実行する場合には、(フレームワーク呼び出しの都合上)Script Debugger上で実行してください。

AppleScript名:InputManagerでIMを切り換える v2
— Created 2017-01-22 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "InputManager" –https://github.com/jensnockert/input-manager

–Caution: This script runs on only Japanese language environment

set cList to current application’s CSInputSource’s all()
set dList to (cList’s valueForKey:"localizedName")
set aRes to ((dList’s indexOfObject:"ひらがな") as integer) –"Hiragana" in Japanese
set bRes to ((dList’s indexOfObject:"英字") as integer) –"English Letters" in Japanese

set hiraKey to cList’s objectAtIndex:aRes
set engKey to cList’s objectAtIndex:bRes

repeat 3 times
  my performSelectorOnMainThread:"selectInputCharMode:" withObject:(hiraKey) waitUntilDone:true
  
delay 1
  
my performSelectorOnMainThread:"selectInputCharMode:" withObject:(engKey) waitUntilDone:true
  
delay 1
end repeat

–Force execute on Main Thread
on selectInputCharMode:aModeObj
  aModeObj’s |select|()
end selectInputCharMode:

★Click Here to Open This Script 

Posted in Input Method Language | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy | 1 Comment

CPU Family Nameを取得する

Posted on 12月 3, 2018 by Takaaki Naganoya

実行中のMacのMachine ID(MacBookPro10,1など)からIntel CPUのFamily Name(Ivy Bridgeなど)を取得するAppleScriptです。

Macの各モデルの搭載CPUについては、MacTrackerを参照しました。

MacTrackerのデータをコピー&ペーストでNumbers上に製品データを作成し(手動)、

ユニーク化(重複データの除去)処理を行なって(ASで処理)、プログラム上に展開しました(手動)。

実用性とか意味については、とくに考えていません。Machine IDとCPU Family Nameのデータについてはplistに記述してプログラム外部に追い出して独自でメンテナンスできるようにしたほうがよいと思われます。

AppleScript名:CPU Family Nameを取得する.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/12/03
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set macID to do shell script "sysctl -n hw.model" –get machine ID
–set macID to "MacBookPro99,1"–Error case

set myName to getIntelCoreProcessorFamilyName(macID) of me
—> "Ivy Bridge"

on getIntelCoreProcessorFamilyName(macID)
  –Machine ID & CPU Core Model Names (uniquefied)
  
set macList to {{"iMac4,1", "Yonah"}, {"iMac4,2", "Yonah"}, {"iMac5,2", "Merom"}, {"iMac5,1", "Merom"}, {"iMac6,1", "Merom"}, {"iMac7,1", "Merom"}, {"iMac8,1", "Penryn"}, {"iMac9,1", "Penryn"}, {"iMac10,1", "Wolfdale"}, {"iMac11,1", "Wolfdale, Lynnfield"}, {"iMac11,2", "Clarkdale"}, {"iMac11,3", "Clarkdale, Lynnfield"}, {"iMac12,1", "Sandy Bridge"}, {"iMac12,2", "Sandy Bridge"}, {"iMac13,1", "Ivy Bridge"}, {"iMac13,2", "Ivy Bridge"}, {"iMac14,1", "Haswell"}, {"iMac14,3", "Haswell"}, {"iMac14,2", "Haswell"}, {"iMac14,4", "Haswell"}, {"iMac15,1", "Haswell"}, {"iMac16,1", "Broadwell"}, {"iMac16,2", "Broadwell"}, {"iMac17,1", "Skylake"}, {"iMac18,1", "Kaby Lake"}, {"iMac18,2", "Kaby Lake"}, {"iMac18,3", "Kaby Lake"}, {"iMacPro1,1", "Skylake"}, {"Macmini1,1", "Yonah"}, {"Macmini2,1", "Merom"}, {"Macmini3,1", "Penryn"}, {"Macmini4,1", "Penryn"}, {"Macmini5,1", "Sandy Bridge"}, {"Macmini5,2", "Sandy Bridge"}, {"Macmini5,3", "Sandy Bridge"}, {"Macmini6,1", "Ivy Bridge"}, {"Macmini6,2", "Ivy Bridge"}, {"Macmini7,1", "Haswell"}, {"Macmini8,1", "Coffe Lake"}, {"MacPro1,1", "Woodcrest"}, {"MacPro2,1", "Clovertown"}, {"MacPro3,1", "Harpertown"}, {"MacPro4,1", "Bloomfield, Gainestown"}, {"MacPro5,1", "Bloomfield, Gulftown, Westmere"}, {"MacPro5,1", "Bloomfield, Westmere, Gulftown"}, {"MacPro6,1", "Ivy Bridge"}, {"MacBook1,1", "Yonah"}, {"MacBook2,1", "Merom"}, {"MacBook3,1", "Merom"}, {"MacBook4,1", "Penryn"}, {"MacBook5,1", "Penryn"}, {"MacBook5,2", "Penryn"}, {"MacBook6,1", "Penryn"}, {"MacBook7,1", "Penryn"}, {"MacBook8,1", "Broadwell"}, {"MacBook9,1", "Skylake"}, {"MacBook10,1", "Kaby Lake"}, {"MacBookAir1,1", "Merom"}, {"MacBookAir2,1", "Penryn"}, {"MacBookAir3,1", "Penryn"}, {"MacBookAir3,2", "Penryn"}, {"MacBookAir4,1", "Sandy Bridge"}, {"MacBookAir4,2", "Sandy Bridge"}, {"MacBookAir5,1", "Ivy Bridge"}, {"MacBookAir5,2", "Ivy Bridge"}, {"MacBookAir6,1", "Haswell"}, {"MacBookAir6,2", "Haswell"}, {"MacBookAir7,1", "Broadwell"}, {"MacBookAir7,2", "Broadwell"}, {"MacBookAir8,1", "Amber Lake Y"}, {"MacBookPro1,1", "Yonah"}, {"MacBookPro1,2", "Yonah"}, {"MacBookPro2,2", "Merom"}, {"MacBookPro2,1", "Merom"}, {"MacBookPro3,1", "Merom"}, {"MacBookPro4,1", "Penryn"}, {"MacBookPro5,1", "Penryn"}, {"MacBookPro5,2", "Penryn"}, {"MacBookPro5,5", "Penryn"}, {"MacBookPro5,4", "Penryn"}, {"MacBookPro5,3", "Penryn"}, {"MacBookPro7,1", "Penryn"}, {"MacBookPro6,2", "Arrandale"}, {"MacBookPro6,1", "Arrandale"}, {"MacBookPro8,1", "Sandy Bridge"}, {"MacBookPro8,2", "Sandy Bridge"}, {"MacBookPro8,3", "Sandy Bridge"}, {"MacBookPro9,2", "Ivy Bridge"}, {"MacBookPro9,1", "Ivy Bridge"}, {"MacBookPro10,1", "Ivy Bridge"}, {"MacBookPro10,2", "Ivy Bridge"}, {"MacBookPro11,1", "Haswell"}, {"MacBookPro11,2", "Haswell"}, {"MacBookPro11,3", "Haswell"}, {"MacBookPro12,1", "Broadwell"}, {"MacBookPro11,4", "Haswell"}, {"MacBookPro11,5", "Haswell"}, {"MacBookPro13,1", "Skylake"}, {"MacBookPro13,2", "Skylake"}, {"MacBookPro13,3", "Skylake"}, {"MacBookPro14,1", "Kaby Lake"}, {"MacBookPro14,2", "Kaby Lake"}, {"MacBookPro14,3", "Kaby Lake"}, {"MacBookPro15,2", "Coffee Lake"}, {"MacBookPro15,1", "Coffee Lake"}}
  
  
–2D List内の検索
  
set gList to searchInListByIndexItem(macList, 1, macID) of me
  
if gList = missing value or gList = {} then
    error "Error:" & macID & "is newer Machine than I expected in Dec 2018 or Older PowerPC Mac , may be"
  end if
  
  
set g2List to FlattenList(gList) of me –複数の結果が得られた場合に備える
  
return contents of second item of g2List
end getIntelCoreProcessorFamilyName

–2Dリストから、指定インデックスアイテムで、指定データが該当する最初のものを返す
on searchInListByIndexItem(aList as list, itemNum as integer, hitData as string)
  set setKey to current application’s NSMutableSet’s setWithArray:aList
  
  
if itemNum < 1 then return {}
  
set aPredicateStr to ("SELF[" & (itemNum – 1) as string) & "] == ’" & hitData & "’"
  
  
set aPredicate to current application’s NSPredicate’s predicateWithFormat:aPredicateStr
  
set aRes to (setKey’s filteredSetUsingPredicate:aPredicate)
  
set bRes to aRes’s allObjects()
  
  
set cRes to bRes as list of string or string –as anything
  
return cRes
end searchInListByIndexItem

–By Paul Berkowitz
–2009年1月27日 2:24:08:JST
–Re: Flattening Nested Lists
on FlattenList(aList)
  set oldDelims to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to {"????"}
  
set aString to aList as text
  
set aList to text items of aString
  
set AppleScript’s text item delimiters to oldDelims
  
return aList
end FlattenList

★Click Here to Open This Script 

Posted in shell script System | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy NSMutableSet NSPredicate | Leave a comment

第8世代Intel Core搭載Mac新モデルでもHaswellと返すsystem info

Posted on 11月 30, 2018 by Takaaki Naganoya

システムまわりの情報を返すAppleScriptの「system info」コマンドが、先日発売された第8世代Intel Coreプロセッサ「Coffe Lake」搭載のMac miniでも「Intel x86-64h Haswell」と返してくることが判明しました。

–> Wikipedia “List of Macintosh models grouped by CPU type”

MacBook Pro Retina 2012だと「CPU type of (system info)」を実行すると、「Intel 80486」と返してきますが、Mac mini 2014だと「Intel x86-64h Haswell」と返します(macOS 10.12.6上で実行)。

先日発売された第8世代Intel Core搭載のMac mini 2018を店頭でさわってみたところ、同機搭載のmacOS 10.14上で、「Intel x86-64h Haswell」と結果を返してきました。


▲PowerBook G4/667(PowerPC G4)@Mac OS X 10.4.11で実行したところ。「PowerPC 7450」と返ってくる

正確なCPU Brand nameを取得するには、こちらの「CPUのBrand Nameとバス速度を表示」AppleScriptを使ってください(CPU Type、Coreの世代を表すコード名ではないのですが、「3720QM」などとBrand Nameを取得できれば、そこから「Ivy Bridge」といった名称テーブルで付け合わせることは十分に可能です)。

CPUアーキテクチャの変わり目の時代に、実行マシンがPowerPC/Intelのどちらかを判定するような用途に使ったこの情報。マシンが想定よりも速すぎる/遅すぎる場合への対策を行うためにこのsystem infoの情報を読んで判定していました。

CPUアーキテクチャが(Intelに)変わってAppleScriptの処理を書き換える必要が出たのは、ファイル処理です。連番ファイルを順次破損チェックして、破損していたら削除して、前の番号のファイルをそのままコピーしてリネームする処理を行なっていたのですが、Intel CPUで実行したら、キャッシュの効きすぎなのか高速なためなのか、破損ファイルが2つ続くとファイルのコピーが間に合わずにエラーになりました。

その際には、処理方式を見直して2パスで(破損画像チェック&削除フェーズ → 欠損画像の補完フェーズ)処理を行うように変更して対処。また、前のファイル番号の画像を単純にコピーするのではなく、空白ブロックを一括で埋める方式に変更して、複数連番画像が欠損しているケースに対応しました。

あとは、データをhexdumpしたときに、byte orderを考慮しつつデータを取り出すような処理を行なったときに、PowerPC/IntelのCPUの違いを検出しました。AppleScript的には、Intel x32とIntel x64の違いについてはほぼ意識する必要はありません。

また、CPUアーキテクチャが変わる可能性があるので、地味にCPUアーキテクチャの確認はおさえておきたいノウハウです。

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

システム環境設定>プライバシーの「オートメーション」項目の表示

Posted on 11月 19, 2018 by Takaaki Naganoya

macOS 10.14, Mojaveでにわかに重要になってきた「システム環境設定」>セキュリティとプライバシー>プライバシー>オートメーション 項目の表示を行うAppleScriptです。

もともと、システム環境設定には指定のPreferences Paneを表示する機能が用意されているのですが、最近このシステム環境設定上の項目の移設や統廃合がメジャーバージョンアップごとに行われており、そうした変更にAppleScript系の機能の変更が間に合っていません。

tell application "System Preferences"
  tell pane "com.apple.preference.security"
    get name of every anchor
  end tell
end tell
–> {"Privacy_Reminders", "Privacy_SystemServices", "Privacy_Calendars", "Firewall", "Privacy_Assistive", "Privacy_LinkedIn", "Privacy_LocationServices", "Privacy_Contacts", "General", "Privacy_Diagnostics", "Advanced", "Privacy_Accessibility", "Privacy_Camera", "FDE", "Privacy", "Privacy_AllFiles", "Privacy_Microphone"}

★Click Here to Open This Script 


▲「セキュリティ」項目以下の各anchor。赤く塗った項目はAppleScript用語辞書に用語が用意されていないもの

とくに、この重要な「オートメーション」項目を示す予約語がAppleScript用語辞書に登録されておらず、「フルディスクアクセス」の予約語が用意されているあたり、チェックもれで抜けたものと思われます。

きちんと予約語が存在する項目については、

tell application "System Preferences"
  activate
  
reveal anchor "Privacy_LocationServices" of pane "com.apple.preference.security"
end tell

★Click Here to Open This Script 

のようにして表示できるのですが、前述のとおり「オートメーション」項目の予約語が用意されていません。

そこで、別途URL Event経由で表示させる方法を見つけたのでまとめておきました。

非同期のURL Eventなので、「オートメーション」項目が表示し終わったかどうかといった確認は一切ありません。普通にApple Event経由で実行できるのであれば、表示し終わったという実行結果の確認まで行えるのですが、、、、

AppleScript名:システム環境設定でオートメーションのタブを表示させる
open location "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"

★Click Here to Open This Script 

Posted in Sandbox System URL | Tagged 10.14savvy System Preferences | Leave a comment

macOS 10.14 AppleScriptリリースノート

Posted on 11月 18, 2018 by Takaaki Naganoya

従来、AppleScriptのRelease Notesは独立して掲載されていましたが、「macOS Mojave 10.14 Release Notes」として1本の記事にまとめて掲載されていました。内容を吟味したうえで日本語訳して掲載します。

macOS 10.14, Mojave上のAppleScriptはバージョン2.7と10.13から変更はありません。このところ、OS2バージョンに1回AppleScript処理系がバージョンアップするような格好になっているため、納得のいくところですが、バージョン番号が変わっていない割には環境が激変しています。控えめに言っても、Classic Mac OSからMac OS Xへの移行時よりも変化が大きい環境です。

(1)アプリケーションとの通信許可システム

あるアプリケーションからApple eventを送信する場合には、AppleScriptアプレットであっても、ユーザーの許可が必要になった。

許可取得中アプリケーションの一覧はシステム環境設定.appの「セキュリティとプライバシー」>「プライバシー」>「オートメーション」カテゴリにて、閲覧や編集が行える。

もしも、ユーザーが許可ダイアログで同意を行わなかった場合には、イベントの実行はブロックされ、エラー-1743(”: Not authorized to send Apple events to “)が発生する。Apple eventはAEDeterminePermissionToAutomateTargetで事前に使用可能かどうかの確認を行える。

(2)OSAXの事実上の廃止

サードパーティーのScripting Additions(OSAX)がインストールできなくなった(認識されなくなった)。/Library/ScriptingAdditions、/Network/Library/ScriptingAdditionsおよび~/Library/ScriptingAdditionsフォルダ内に存在するScripting Additionsは無視される。

アプリケーションの一部品としてScripting Additionsをバンドル内に組み込み、アプリケーションとScripting Additionsの両方が同一IDでコードサインを施された場合にのみ実行が許可される。

リリースノート内容の検証

(1)について

アプリケーションとの通信許可が行われる頻度ですが、

 スクリプトエディタ:(確認対象外)
 Script Debugger:実行時初回のみ
 スクリプトメニュー:実行時初回のみ
 AppleScriptアプレット:毎回(初回通信時のみ)実行時初回のみ
 AppleScriptアプレット(Code Sign):初回実行時のみ
 AppleScript GUIアプリケーション(Code Sign):初回実行時のみ

となっています(2019/2/1修正)。アプリケーションとの通信許可が求められる単位は、各実行ファイル。Script Debugger上でScriptを記述するためにSafariと通信を行う場合には、初回のみ許可を求められます。スクリプトエディタ上でAppleScriptを記述する場合には、とくに通信許可の確認ダイアログは表示されません。

許可されたアプリケーション一覧については、/usr/bin/tccutilコマンドでリセット可能。
許可状況のリストアップについては、/Library/Application Support/com.apple.TCC/TCC.dbにて管理。Apple純正ツールtccutilでは削除しかできない状況です。

→ その後、Hal Mueller氏によるサンプルコードを用いたtccKit.frameworkを介して、指定Bundle IDの「オートメーション」認証状況を取得できるようになりました

ただし、同じく「プライバシー」項目の「フルディスクアクセス」に、スクリプトエディタとスクリプトメニューを登録する必要があります。OSインストールや10.14以下のOSからのアップデート時、新規ユーザーアカウント作成時に行う「恒例行事」になることでしょう。

(2)について

Script Addition(=OSAX)の使用/不使用をuse scripting additions文で制御できますが、事実上これがOS標準装備のStandard Additions OSAXおよびDigital Hub Scriptingの使用/不使用制御を行うためだけの存在になったといえます。

現在残存している著名なサードパーティのOSAXに、

・Satimage OSAX
・XMLTools

などがあり、これらは、LateNight SoftwareにてCode Signしてアプリケーション化した「SatimageOSAX.app」を配布して同アプリケーション内蔵のSatimage.osax/XMLLib.osax/Files.osax/FITS.osax/Numerics.osaxを呼び出す環境を提供しています。

ただし、今後もScripting Additions/OSAXの利用について制約が緩和される可能性はないため、移行のための「その場しのぎ」に限定されます。OSAXによるScript機能の拡張については、これで終了です。

個人的には、Classic MacOSからMac OS X(現・macOS)への移行の際に、OSAXになるべく依存しないようにAppleScriptを記述するように方針転換し、本Blog掲載のScriptについても「よほどのこと」がなければOSAXを使用していません。XMLからXPathを用いてデータを取得する用途についてはXMLTools OSAXの機能が強力ですが、XPathQuery4ObjCなどの代替手段を用意しています。

なお、macOS 10.14搭載のスクリプトエディタは~/Library/Frameworksフォルダ内のFrameworkを無視するものの、これが「仕様」なのか「バグ」なのかは不明。Shane Stanley的には「仕様」とのこと。
→ SIPの機能による制限。これを回避するためにはTerminal上からcsrutilコマンドによりSIPを無効化する操作が必要

その他の変更内容

Script Menuは「スクリプトメニュー」という別アプリケーションに分離されました。

Script MenuはこれまでMenu Exrtraとして存在していたのですが、macOS 10.14で変更されたかたちです(Script Menuは時代によってSystem Eventsが管轄していたり、独立したアプリケーションだった時期があったりとけっこういろいろ存在形態が変更され続けてきました)。Menu Extraから独立アプリケーションへの変更はセキュリティポリシーを独自に適用するため、でしょうか?(なんとなく意図は理解できそうですが、こんな大事なことはリリースノートに書いてほしい)

macOS 10.14搭載のContacts.app(旧称:アドレスブック)から、プラグインScriptがサポートされなくなりました。Contacts.appのAppleScript用語辞書にはプラグインScript用の用語が残っているため注意が必要です。

Finderに、デスクトップ上のファイルを「過去7日間」「過去30日間」などとまとめる「スタック」の機能が付きました。AppleScriptからこの「スタック」を選択してselection(as alias list)を取得すると、中に入っているファイルへの参照がリストで返ってきます(スタックに該当するクラスが定義されているわけではありません)。

DVDプレイヤーはアプリケーションから補助ツールに格下げになって(Zipアーカイバなどと同じ)AppleScriptからの操作機能が削除されました。DVD再生コントロールなどはフリーの「Free Mac Media Player」をダウンロードして行うようにしてください。

Posted in System | Tagged 10.14savvy | 2 Comments

MIKMIDIでデバイス一覧を取得 v2

Posted on 11月 4, 2018 by Takaaki Naganoya

オープンソースのフレームワーク「MIKMIDI」を用いてMIDIデバイス情報を取得するAppleScriptです。

Objective-Cのプログラムもいろいろ読んできましたが、その中でもこれは難易度が高く、高尚であるために読んでもさっぱりわかりません。

–> Download MIKMIDI.framework(To ~/Library/Frameworks/)

AppleScript名:MIKMIDIでデバイス一覧を取得 v2
— Created 2015-11-13 by Takaaki Naganoya
— 2015 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "MIKMIDI" –https://github.com/mixedinkey-opensource/MIKMIDI

property midiDeviceManager : missing value

set midiDeviceManager to current application’s MIKMIDIDeviceManager’s sharedDeviceManager()’s availableDevices()
set aRes to midiDeviceManager’s mutableCopy()

set endpointsInDevs to current application’s NSMutableSet’s |set|()
repeat with i in (midiDeviceManager as list)
  set aSrcList to (current application’s NSSet’s setWithArray:(i’s entities()’s valueForKeyPath:"sources"))
  
set aDstList to (current application’s NSSet’s setWithArray:(i’s entities()’s valueForKeyPath:"destinations"))
  (
endpointsInDevs’s unionSet:aSrcList)
  (
endpointsInDevs’s unionSet:aDstList)
end repeat

endpointsInDevs’s |description|()
–>  (NSSet) {{(MIKMIDISourceEndpoint) <MIKMIDISourceEndpoint: 0x7f8a61d47950> 新しい外部装置}, {(MIKMIDISourceEndpoint) <MIKMIDISourceEndpoint: 0x7f8a63a65610> IAC Driver GarageBand}, {(MIKMIDIDestinationEndpoint) <MIKMIDIDestinationEndpoint: 0x7f8a61bbc130> IAC Driver GarageBand}, {(MIKMIDIDestinationEndpoint) <MIKMIDIDestinationEndpoint: 0x7f8a5ecadcf0> 新しい外部装置}}

–midiDeviceManager’s virtualSources() –Real MIDI I/Fがつながっていないとエラーになる
–set devicelessSources to current application’s NSMutableSet’s setWithWrray:(midiDeviceManager’s virtualSources())

★Click Here to Open This Script 

Posted in MIDI System | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

【基礎】AppleScriptの実行を(操作により)中断する

Posted on 10月 30, 2018 by Takaaki Naganoya

AppleScriptの実行を途中で任意に停止したい、という場合があります。そのための方法についてまとめておきました。

# Blog消失前の投稿を再構成して「たぶんこんな内容」と推測して投稿したものです

実行を中断させる方法はいくつか存在します。ただし、そのためには「何によってAppleScriptが実行されているか」、つまり「ランタイム環境が何なのか?」を明らかにする必要があります。

AppleScriptのランタイム環境は、つきつめると数種類「しか」ないわけですが、そのランタイム環境を呼び出している側のアプリケーションにどの程度の制約を課されているか、という要素も加わってきます。

システムのあちらこちらに存在しているAppleScriptのランタイム環境のうち、ユーザーに近い部分のものについて述べることにしましょう。

ランタイム環境が「スクリプトエディタ」の場合の止め方

スクリプトエディタ上で実行中のAppleScriptは、Command-.(ピリオド)で停止できるようになっています。

ただし、すでに操作対象のアプリケーション側に制御が移っている場合には、アプリケーション側の処理が終わるまで待たされますし、アプリケーションが最前面にくるように(activate)AppleScriptが書かれていた場合には、スクリプトエディタに対して停止のキーボードショートカットを送ることは困難です。

最終的には、Command-Option-Escapeで実行中のプロセス一覧を表示させて、スクリプトエディタを強制終了させることになります。

もちろん、Terminal.app上で、Script Editor.appのプロセス番号を調べて、

% kill -7 xxx

などと野蛮な止め方をしてもよいでしょう。AppleScriptの実行を野蛮な方法で停止しても、AppleScriptの内容が壊れることはまずありません。ただし、処理していたデータは中途半端な状態のままになってしまいます。こうした処理を行う場合には、くれぐれも元データを保持しておいて、AppleScriptによる処理が失敗したり途中で停止するようなことになっても、再度実行できるようにしておきましょう。

ランタイム環境がアプレットの場合の止め方

個人的に、AppleScriptアプレットというランタイム環境はスクリプトエディタ上と挙動が変わってくるので、あまり好きではありません。それでも、タイマー割り込みやドラッグ&ドロップなどの機能を使う場合にはアプレット(ドロップレット)として保存する必要が出てきます。

アプレットの場合も、スクリプトエディタ同様Command-.(ピリオド)で止めることになりますが、たいてい止まらないのでCommand-Option-Escapeによる強制終了、あるいはターミナルから実行中のアプレットのプロセスIDを調べて強制終了、でもよいでしょう。

ランタイム環境がスクリプトメニューの場合の止め方

スクリプトメニューをどのプログラムが受け持っているか、Mac OS Xの歴史を振り返ると、いろいろ移り変わりがありました。実行するアプリケーションが単独で存在していたり、System Eventsが受け持っていたり、osascriptを呼び出していたり、ふたたび単体のアプリケーションに戻ったり。OSのバージョンを限定して話をすると、macOS 10.10〜10.13の環境ではosascriptによって実行されてきました。

スクリプトメニューからAppleScriptを実行させると、メニューに回転する歯車アイコンが表示されます。この歯車アイコンをクリックすると実行中のAppleScript一覧が表示され(複数のScriptを並行して同時に実行させることもできます)各Scriptの右下の×ボタンを押すと停止できます。

これでも止まらない場合には、Terminalからosascriptのプロセスをkillすれば大丈夫です。

macOS 10.14ではスクリプトメニューが「スクリプトメニュー」という別のアプリケーションとして実装されたので、macOS 10.14上のスクリプトメニューのランタイム環境は「スクリプトメニュー」です。Command-Option-Escapeでは終了できないので、ターミナルから「スクリプトメニュー」のプロセスIDを調べてkillすることになります。

その他の止め方

Xcode上でAppleScriptによるGUIアプリケーションを作成し、InDesignやIllustratorなどのアプリケーションを操作する処理を実行。この外部アプリケーションの操作を行う処理を止めたいといった場合もあります。

AppleScript Studioの頃とは異なり、最近のAppleScriptObjCによるGUIアプリケーション作成時には、GUIアプリケーション側と外部アプリケーション操作側は完全に分離され、後者についてはXcode上では編集すらできません。データの受け渡しはuser defaults経由で行ったりしています。

難易度の低いやり方は、外部アプリ制御側Scriptで、「処理ループ内で何らかのシグナルを監視する」というものです。特定フォルダの有無でも「メッセージ」アプリケーションのステータスメッセージでも特定Webサーバー上の特定URLのファイルでもよいのですが、それらが存在した場合には停止、というプログラム自体を組んでおきます。デスクトップ上に「Stop」という名前のフォルダが存在していたら終了、というあたりがわかりやすくて簡単な実装例でしょう。

難易度の高いやり方は、外部アプリ制御Scriptを、メモリ上に作成したOSAScriptView上で実行し、停止時にはOSAScriptControllerにstopScript:メソッドを実行するというものです。もちろん、外部アプリ制御Scriptはアプリケーションバンドル内に暗号化したファイルに保存しておき、実行時に復号化してOSAScriptViewにロードすることになります。ユーザーからの停止の仕組みを受け取るのは、Shiftキーなどのキースキャンを定期的に行うことで実現できます。

難易度の高い方が柔軟に止められますが、おすすめは難易度の低いほうです。

Posted in OSA System | 1 Comment

光学ドライブのオープン(イジェクト)

Posted on 10月 29, 2018 by Takaaki Naganoya

光学ドライブのオープン(メディアのイジェクト)を行うAppleScriptです。

すっかり、Macのラインナップから光学ドライブ標準搭載モデルがなくなって、外付けの光学ドライブばかりというか、そもそも光学ドライブを持っていないというユーザーが増えてきたので、光学メディアでのデータ配布そのものが無意味になりつつある昨今。

光学ドライブもトレイ式(トレイ開閉が電動)のものがほぼ絶滅状態(Pioneerのみ製造?)。スリムタイプのスロットイン方式か、薄型トレイ(イジェクトしたまま戻らない)方式のみなので、光学メディアのイジェクトについて分かればよいでしょう。

drutilコマンドのほか、macOS 10.13まではDVDプレイヤーがScriptableだったので、DVDプレイヤーに対してejectコマンドを送る方法もありました(10.14でScripting機能が廃止に……アプリケーション自体を作り直したもよう)。


macOS 10.12/13:DVDプレイヤー(32bit) ファイルサイズ:6.4MB バージョン:5.8


macOS 10.14:DVDプレイヤー(64bit) ファイルサイズ:2.1MB バージョン: 6.0
注:macOS 10.14のDVDプレイヤーは/System/Library/CoreServices/Applications/にある。アプリケーションから補助ツールに格下げになった。

これまでDVDプレイヤーが担ってきた用途については、フリーの「Free Mac Media Player」で置き換えるのがよいと思われます。

AppleScript名:光学ドライブのトレイオープン(内蔵ドライブのみ)
do shell script "/usr/bin/drutil eject internal"

★Click Here to Open This Script 

AppleScript名:光学ドライブのトレイオープン(外付けドライブのみ)
do shell script "/usr/bin/drutil eject external"

★Click Here to Open This Script 

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

スリープ復帰日時を設定する v2

Posted on 10月 29, 2018 by Takaaki Naganoya

指定の日時(年月日時分秒)にスリープ復帰日時を設定するAppleScriptです。

過去に掲載した記事の再掲載分ですが、以前に掲載したリストにバグが見つかったので修正しておきました。サブルーチン内でパラメータの変数と同じ名前の変数に代入してしまい、計算結果がおかしくなるという超恥ずかしいバグでした。

AppleScript名:スリープ復帰日時を設定する v2
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aYear to 2018 –年
set aMonth to 10 –月
set aDate to 30 –日

set aHour to 7 –時
set aMinute to 1 –分
set aSecond to 2 –秒

set myAccount to do shell script "whoami" –他に管理者アカウントを指定することも可。その場合にはmyPasswordには管理者のパスワードを指定
set myPassword to "" –パスワード(カラのままでOK。必要に応じてAS側からダイアログ入力を求める)

set pRes to setAwakeDate(aYear, aMonth, aDate, aHour, aMinute, aSecond, myAccount, myPassword) of me

–スリープからの復帰日時を設定する
on setAwakeDate(aYear, aMonth, aDate, aHour, aMinute, aSecond, myAccount, myPassword)
  if myPassword = "" then
    set myPassword to text returned of (display dialog "パスワードを入力してください" default answer "" with hidden answer)
  end if
  
  
–現在のユーザーに管理権限がない場合にはリターン
  
if getUsersPrivileges(myAccount) of me = false then return false
  
  
–過去の日時を指定していたら設定しない(過去掲載時にここが間違っていたので修正)
  
set tmpDate to getDateInternational(aYear, aMonth, aDate, aHour, aMinute, aSecond, "JST")
  
if ((current date) > tmpDate) then return false
  
  
–数値の整形(日付)
  
set tYear to retZeroPaddingText(aYear, 2) of me
  
set tMonth to retZeroPaddingText(aMonth, 2) of me
  
set tDate to retZeroPaddingText(aDate, 2) of me
  
  
–数値の整形(時刻)
  
set tHour to retZeroPaddingText(aHour, 2) of me
  
set tMinute to retZeroPaddingText(aMinute, 2) of me
  
set tSecond to retZeroPaddingText(aSecond, 2) of me
  
  
set tDateStr to (ASCII character 34) & tMonth & "/" & tDate & "/" & tYear & " " & tHour & ":" & tMinute & ":" & tSecond & (ASCII character 34)
  
  
try
    set sRes to (do shell script "/usr/bin/pmset schedule wake " & tDateStr user name myAccount password myPassword with administrator privileges)
  on error erMes
    return erMes –時間を過去に設定したか、あるいは数値の範囲指定エラー。パスワードの指定ミスの可能性もあり得る
  end try
  
  
return true
  
end setAwakeDate

–指定ユーザーの権限を得る(管理者か、それ以外か) 10.4および10.5以降両用
–管理者だとtrueが、それ以外だとfalseが返る
on getUsersPrivileges(aUser)
  set aVer to system attribute "sys2" –OSメジャーバージョンを取得する(例:Mac OS X 10.6.4→6)
  
  
set current_user to aUser
  
  
if aVer > 4 then
    –Mac OS X 10.5以降の処理
    
set adR to (do shell script "/usr/bin/dsmemberutil checkmembership -U " & current_user & " -G admin users")
    
    
if adR = "user is a member of the group" then
      return true
    else
      return false
    end if
    
  else
    –Mac OS X 10.4までの処理
    
set admin_users to (do shell script "/usr/bin/niutil -readprop . /groups/admin users")
    
tell (a reference to AppleScript’s text item delimiters)
      set {old_atid, contents} to {contents, " "}
      
set {admin_users, contents} to {text items of admin_users, old_atid}
    end tell
    
    
if current_user is in admin_users then
      return true
    else
      return false
    end if
  end if
  
end getUsersPrivileges

–数値にゼロパディングしたテキストを返す
on retZeroPaddingText(aNum, aLen)
  set tText to ("00000000" & aNum as text)
  
set tCount to length of tText
  
set resText to text (tCount – aLen + 1) thru -1 of tText
  
return resText
end retZeroPaddingText

–Make a GMT Date Object with parameters from a given time zone.
on getDateInternational(aYear, aMonth, aDay, anHour, aMinute, aSecond, timeZoneAbbreviation)
  set theNSCalendar to current application’s NSCalendar’s currentCalendar()
  
theNSCalendar’s setTimeZone:(current application’s NSTimeZone’s timeZoneWithAbbreviation:(timeZoneAbbreviation))
  
set theDate to theNSCalendar’s dateWithEra:1 |year|:aYear |month|:aMonth |day|:aDay hour:anHour minute:aMinute |second|:aSecond nanosecond:0
  
return theDate as date
end getDateInternational

★Click Here to Open This Script 

Posted in Calendar System | Tagged 10.11savvy 10.12savvy | Leave a comment

現在地点の緯度経度情報を取得する v2

Posted on 10月 29, 2018 by Takaaki Naganoya

WiFiの情報を元に現在地点の緯度経度情報を取得するAppleScriptです。

実行前にWiFiがオンになっている必要があるので、WiFiの状態を確認して、WiFiがオフだったらオンにする処理が必要になります。

AppleScript名:現在地点の緯度経度情報を取得する v2
— Created 2015-03-04 by Takaaki Naganoya, Shane Stanley
— Modified 2015-12-06 by Takaaki Naganoya
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "CoreLocation"

property locationManager : missing value
property curLatitude : 0
property curLongitude : 0

–Get Current Geo Location
set {aLat, aLong} to getCurrentGeoLocation() of me

on getCurrentGeoLocation()
  set locationManager to current application’s CLLocationManager’s alloc()’s init()
  
  
set locE to locationManager’s locationServicesEnabled()
  
if (locE as boolean) = true then
    locationManager’s setDelegate:me
    
locationManager’s setDesiredAccuracy:(current application’s kCLLocationAccuracyNearestTenMeters)
    
locationManager’s setDistanceFilter:500
    
locationManager’s startUpdatingLocation()
  else
    return false –error in init
  end if
  
  
set hitF to false
  
repeat 3000 times
    if {curLatitude, curLongitude} is not equal to {0, 0} then
      set hitF to true
      
exit repeat
    end if
    
delay ("0.0001" as real)
  end repeat
  
  
if hitF = false then return {false, false}
  
return {curLatitude, curLongitude}
end getCurrentGeoLocation

on locationManager:manager didUpdateLocations:locations
  set location to (locations’s lastObject())
  
set eventDate to (location’s timestamp())
  
set howRecent to (eventDate’s timeIntervalSinceNow())
  
set howRecent to howRecent as real
  
set howRecent to absNum(howRecent)
  
  
if howRecent < 15.0 then
    set alt to location’s altitude –>(NSNumber) 46.356517791748
    
set aSpeed to location’s speed –>(NSNumber) -1.0
    
set aCourse to location’s course –North:0, East:90, South:180, West:270
    
–>  (NSNumber) -1.0
    
set theDescription to location’s |description|()
    
–> (NSString) "<+35.xxxxx,+139.xxxxxx> +/- 65.00m (speed -1.00 mps / course -1.00) @ 2015/03/04 8時56分41秒 日本標準時"
    
set anNSScanner to current application’s NSScanner’s scannerWithString:theDescription
    
anNSScanner’s setCharactersToBeSkipped:(current application’s NSCharacterSet’s characterSetWithCharactersInString:"<,")
    
set {theResult, aLat} to anNSScanner’s scanDouble:(reference)
    
set {theResult, aLng} to anNSScanner’s scanDouble:(reference)
    
copy {aLat, aLng} to {my curLatitude, my curLongitude}
  else
    locationManager’s stopUpdatingLocation()
  end if
  
end locationManager:didUpdateLocations:

on locationManager:anCLLocationManager didFailWithError:anNSError
  display dialog (anNSError’s localizedDescription() as text)
end locationManager:didFailWithError:

on absNum(aNum)
  if aNum > 0 then
    return aNum
  else
    return (aNum * -1)
  end if
end absNum

★Click Here to Open This Script 

Posted in geolocation System WiFi | Tagged 10.11savvy 10.12savvy 10.13savvy CLLocationManager NSCharacterSet NSScanner | Leave a comment

日本語入力のライブ変換のオン、オフ v2

Posted on 10月 28, 2018 by Takaaki Naganoya

日本語入力Input Methodの「ライブ変換」のOn/Offの状態を変更するAppleScriptのmacOS 10.13/10.14対応版です。

大した箇所ではなく、NSDictionaryの作成が通らなかったのできっちり書きました。こういう些細な表記がOSバージョンごとに変わってくるのがCocoa Scriptingの要注意点でしょうか。

AppleScript名:ライブ変換のオン、オフ v2
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/10/28
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—

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

makeLiveHenkanEnabled(true) of me –Enable
makeLiveHenkanEnabled(false) of me –Disable

–日本語入力の「ライブ変換」をオン/オフする。Sandbox環境では動作しない
on makeLiveHenkanEnabled(aFlag as boolean)
  set fNumFlag to aFlag as integer
  
  
set aRec to current application’s NSDictionary’s dictionaryWithObjects:{fNumFlag} forKeys:{"JIMPrefLiveConversionKey"}
  
  
current application’s NSDistributedNotificationCenter’s defaultCenter()’s postNotificationName:"com.apple.inputmethod.JIM.PreferencesDidChangeNotification" object:"com.apple.JIMSession" userInfo:aRec options:0
  
  
current application’s NSDistributedNotificationCenter’s defaultCenter()’s postNotificationName:"com.apple.inputmethod.JIM.PreferencesDidChangeNotification" object:"com.apple.JIMPreferences" userInfo:aRec options:0
end makeLiveHenkanEnabled

★Click Here to Open This Script 

Posted in Input Method Record System | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy NSDictionary NSDistributedNotificationCenter | Leave a comment

日本語入力のライブ変換のオン、オフ

Posted on 10月 28, 2018 by Takaaki Naganoya

日本語入力Input Methodの「ライブ変換」のOn/Offの状態を変更するAppleScriptです。

Sandbox環境下では動作しないとのこと。Xcode上で作成したMac App Store向けのGUIアプリケーション環境(Sandbox環境下)だと機能しない可能性が高いとのこと。

テストしてみたところ、macOS 10.13/10.14で動作しなかったため、あとで少々書き換えてみました(v2)。

個人的には、日本語入力のライブ変換は真っ先にオフにする心底いらない機能です。

AppleScript名:ライブ変換のオン、オフ.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/10/28
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—

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

makeLiveHenkanEnabled(true) of me –Enable
makeLiveHenkanEnabled(false) of me –Disable

–日本語入力の「ライブ変換」をオン/オフする。Sandbox環境では動作しない
on makeLiveHenkanEnabled(aFlag as boolean)
  set fNumFlag to aFlag as integer
  
  
set aRec to current application’s NSDictionary’s dictionaryWithObjectsAndKeys_((fNumFlag), "JIMPrefLiveConversionKey")
  
current application’s NSDistributedNotificationCenter’s defaultCenter()’s postNotificationName:"com.apple.inputmethod.JIM.PreferencesDidChangeNotification" object:"com.apple.JIMSession" userInfo:aRec options:0
  
  
set bRec to current application’s NSDictionary’s dictionaryWithObjectsAndKeys_((fNumFlag), "JIMPrefLiveConversionKey")
  
current application’s NSDistributedNotificationCenter’s defaultCenter()’s postNotificationName:"com.apple.inputmethod.JIM.PreferencesDidChangeNotification" object:"com.apple.JIMPreferences" userInfo:bRec options:0
end makeLiveHenkanEnabled

★Click Here to Open This Script 

Posted in Input Method Record System | Tagged 10.11savvy 10.12savvy NSDictionary NSDistributedNotificationCenter | Leave a comment

日本語入力のライブ変換の状態をBooleanで取得する

Posted on 10月 28, 2018 by Takaaki Naganoya

日本語入力Input Methodの「ライブ変換」のOn/Offの状態を取得するAppleScriptです。

本Scriptは状態を取得する「だけ」で、強制設定などは行いません。

個人的には、この「ライブ変換」機能はまったく信用に値しないので、macOS環境で真っ先にオフにする不要な機能です。

AppleScript名:ライブ変換の状態をBooleanで取得する.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/10/28
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
–   http://www.mindto01s.com/2017/03/27/9f85c2fb_9f90_4e1b_8e5e_8719f57900eb.html

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

set imRes to getLiveHenkanStatus() of me
–> true : 「ライブ変換」On
–> false : 「ライブ変換」Off

on getLiveHenkanStatus()
  set theUD to current application’s NSUserDefaults’s alloc()’s initWithSuiteName:"com.apple.inputmethod.Kotoeri"
  
set imRes to (theUD’s valueForKey:"JIMPrefLiveConversionKey") as boolean
  
return imRes
end getLiveHenkanStatus

★Click Here to Open This Script 

Posted in Input Method System | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy NSUserDefaults | Leave a comment

アプリケーションの各種記法からBundle IDを求める

Posted on 10月 26, 2018 by Takaaki Naganoya

各種記法で記述したアプリケーション名から、Bundle IDを求めるAppleScriptです。

アプリケーション名(本当の名前)、Bundle ID、アプリケーションのフルパス(POSIX path)の3形式で記述したアプリケーション名から、Bundle IDを求めます。

ただし、Localized Name(Reminders–>「リマインダー」、Notes–>「メモ」)からBundle IDの取得は本Scriptではサポートしていません。

AppleScript名:アプリケーションの各種記法からBundle IDを求める
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set apList to {"Finder", "System Events", "com.apple.Finder", "/Applications/Safari"}
set bIDList to retAppBundleID(apList) of me
–> {"com.apple.finder", "com.apple.systemevents", "com.apple.Finder", "com.apple.Safari"}

–Application name list –> Bundle ID list
on retAppBundleID(appNameList)
  set resList to {}
  
  
repeat with i in appNameList
    set j to contents of i
    
    
if j starts with "/Applications/" then
      –POSIX path
      
if j does not end with ".app" then
        set j to j & ".app"
      end if
      
set aRes to getBundleIDFromPath(j) of me
      
    else if j contains "." then
      –Bundle ID (maybe)
      
copy j to aRes
    else
      –Application Name
      
set aRes to getBundleIDFromAppName(j) of me
    end if
    
    
set the end of resList to aRes
  end repeat
  
  
return resList
end retAppBundleID

–Application path –> Bundle ID
on getBundleIDFromPath(aPOSIXpath)
  set aURL to current application’s |NSURL|’s fileURLWithPath:aPOSIXpath
  
set aWorkspace to current application’s NSWorkspace’s sharedWorkspace()
  
set appURL to aWorkspace’s URLForApplicationToOpenURL:aURL
  
set aBundle to current application’s NSBundle’s bundleWithURL:appURL
  
set anID to aBundle’s bundleIdentifier()
  
return anID as string
end getBundleIDFromPath

–Application Name –> path –> Bundle ID
on getBundleIDFromAppName(appName)
  try
    –Localized Name will require choose application dialog
    
set appPath to POSIX path of (path to application appName)
  on error
    return ""
  end try
  
return getBundleIDFromPath(appPath) of me
end getBundleIDFromAppName

★Click Here to Open This Script 

Posted in file File path System | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy | Leave a comment

iTunesライブラリ中の各trackのartworkの種別を集計 v2

Posted on 10月 16, 2018 by Takaaki Naganoya

iTunesライブラリ中の各trackのアートワークの画像フォーマットの種別を集計するAppleScriptです。

iTunesライブラリ中の各trackのアートワークの画像フォーマットについては、iTunes.app上で楽曲を何曲か選択状態にした状態で、

tell application "iTunes"
  set aSel to selection
  
–> {file track id 50115 of user playlist id 43242 of source id 65 of application "iTunes"}
  
  
repeat with i in aSel
    set j to contents of i
    
    
set aFormat to (format of artwork 1 of j) as string
    
log aFormat
    
–>   (*JPEG picture*)
  end repeat
end tell

★Click Here to Open This Script 

のように、個別に取り出すことが可能です。

ただし、iTunes内の(数千とか数万)trackすべてについて集計を行いたい、といった場合にiTunes.appに対して問い合わせを行うと、Objective-CだろうがSwiftだろうがAppleScriptだろうが、どの言語を使っても膨大な処理時間がかかります。

そこで、iTunesLibrary.frameworkを介して、iTunesライブラリに直接アクセスしてアートワーク画像の集計を行なってみました。iTunes.appに対して数千個のtrackのアートワークの画像フォーマットを確認していては、処理に何時間かかるかわかりませんが、直接Frameworkの機能を呼び出せば、迅速に処理できます。

開発環境(MacBook Pro 2012 Core i7 2.66GHz)で、iTunesに音楽が6,800曲程度入っている環境で、集計処理に10秒程度かかりました。アートワークにアクセスすると楽曲情報よりも多めに処理時間がかかるようです。

アートワークの種別については、iTunesLibrary.frameworkが定めるところでは9種類ほど画像フォーマットが存在し、自分の環境ではJPEGが多く、PNGもありました。

macOS 10.14でも動かしてみましたが、とくに問題ありません。GUIアプリへの問い合わせではないので、「オートメーション」の許可ダイアログも表示されません。

AppleScript名:各trackのartworkの種別を集計 v2.scptd
— Created 2018-10-16 by Takaaki Naganoya
— 2018 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "iTunesLibrary"

–https://developer.apple.com/documentation/ituneslibrary/itlibartwork/itlibartworkformat?language=objc
property ITLibArtworkFormatNone : 0
property ITLibArtworkFormatBitmap : 1
property ITLibArtworkFormatJPEG : 2
property ITLibArtworkFormatJPEG2000 : 3
property ITLibArtworkFormatGIF : 4
property ITLibArtworkFormatPNG : 5
property ITLibArtworkFormatBMP : 6
property ITLibArtworkFormatTIFF : 7
property ITLibArtworkFormatPICT : 8

set library to current application’s ITLibrary’s libraryWithAPIVersion:"1.0" |error|:(missing value)
if library is equal to missing value then return

set playLists to library’s allPlaylists()
set gArray to library’s allMediaItems()’s artwork

set imgFormatArray to gArray’s imageDataFormat

set aRes to countItemsByItsAppearance(imgFormatArray) of me
–>{{theName:2, numberOfTimes:4001}, {theName:missing value, numberOfTimes:2659}, {theName:5, numberOfTimes:1884}}

–出現回数で集計
on countItemsByItsAppearance(aList)
  set aSet to current application’s NSCountedSet’s alloc()’s initWithArray:aList
  
set bArray to current application’s NSMutableArray’s array()
  
set theEnumerator to aSet’s objectEnumerator()
  
  
repeat
    set aValue to theEnumerator’s nextObject()
    
if aValue is missing value then exit repeat
    
bArray’s addObject:(current application’s NSDictionary’s dictionaryWithObjects:{aValue, (aSet’s countForObject:aValue)} forKeys:{"theName", "numberOfTimes"})
  end repeat
  
  
–出現回数(numberOfTimes)で降順ソート
  
set theDesc to current application’s NSSortDescriptor’s sortDescriptorWithKey:"numberOfTimes" ascending:false
  
bArray’s sortUsingDescriptors:{theDesc}
  
  
return bArray as list
end countItemsByItsAppearance

★Click Here to Open This Script 

Posted in list System | Tagged 10.11savvy 10.12savvy 10.13savvy 10.14savvy iTunes | Leave a comment

GUI Scripting的なUI Elementへの参照から所属するアプリケーション名を取得する

Posted on 9月 17, 2018 by Takaaki Naganoya

GUI Scripting的なUI Elementへの参照をもとに、そのUI Elementが所属するアプリケーション名を取得するAppleScriptです。

こんな、Safariの「ファイル」メニューの中にあるメニュー項目、

menu item “PDFとして書き出す…” of menu “ファイル” of menu bar item “ファイル” of menu bar 1 of application process “Safari”

があったとして、このオブジェクトが所属しているアプリケーション名を取得したいというケースがありました。上記の例では「Safari」がそれに該当します。

GUI Scripting的なお約束として、オブジェクト階層が上から下に向かって取得する場合には「entire contents」でまとめて取得できるのですが、下から上に向かってparentで取得できるわけでもなく、アプリケーションプロセス名をさかのぼって取得するといった処理ができていませんでした。

AppleScriptの「仕様」的には不可能です。

でも、不可能であることさえわかれば(正攻法では不可能なので)、いつものトリッキーかつ邪道な手口でなんとかなりそうです。

そうです、エラートラップ中で無理やりエラーを起こして、そのエラーメッセージの情報から取得してしまおうという、いつものやつです。

というわけで、GUI Elementの情報から所属アプリケーション名を取得できました。

最近は、さらなる「卑劣な手段」を用意しているので、そちらで華麗かつ卑劣に処理してもよかったのですが、とりあえず手短にまとめたかったのでいつものやつで処理しました。

AppleScript名:GUI Scripting的なUI Elementへの参照から所属するアプリケーション名を取得する.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/09/17
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—

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

tell application "System Events"
  set aRef to menu item "PDFとして書き出す…" of menu "ファイル" of menu bar item "ファイル" of menu bar 1 of application process "Safari"
end tell

set appName to retRootAppProcessNameFromGUIElementRef(aRef) of me
–> "Safari"

–GUI Scripting的なUI Elementへの参照から、rootのアプリケーションプロセス名を取得する
on retRootAppProcessNameFromGUIElementRef(aRef)
  try
    set aStr to aRef as string –force cause error
  on error erM
    set offsetA to offset of " of application \"System Events\"" in erM
    
set offsetB to offset of "«class pcap» " in erM
    
set appName to text (offsetB + (length of "«class pcap» ") + 1) thru (offsetA – 2) of erM
    
return appName as string
  end try
end retRootAppProcessNameFromGUIElementRef

★Click Here to Open This Script 

Posted in GUI GUI Scripting System | Tagged 10.11savvy 10.12savvy 10.13savvy System Events | Leave a comment

iCloud Driveフォルダへのパスを求める

Posted on 9月 16, 2018 by Takaaki Naganoya

iCloud Driveフォルダへのパスを求めるAppleScriptです。

ただ、これほどわかりにくいものも珍しいことでしょう。自分も避けておきたい仕様です。

パスについての仕様はあり、ファイルの読み書きなどはできそうですが、求めたパスをFinder上で指定すると不思議なことになります。

Finderのサイドバーから「iCloud Drive」アイコンをクリックすると、

のような表示になります。このときのFinder Windowのtargetを取得すると、~/Library/Mobile Documentsが返ってきます(形式はFinder Objectですけれども)。ただ、これと同じことをAppleScript側から行なっても、同じ結果が得られないというジレンマがあります。

~/Library/Mobile Documents

AppleScript名:iCloud Drivegフォルダへのパスを求める
set iCloudPath to ((path to library folder from user domain as string)) & "Mobile Documents:"
tell application "Finder"
  make new Finder window
  
set target of Finder window 1 to (iCloudPath as alias)
end tell

★Click Here to Open This Script 

これは、~/Library/Mobile Documentsをオープンするものですが、これを実行すると、

のようになります。

~/Library/Mobile Documents/com~apple~CloudDocs

これみたいですね。

AppleScript名:iCloud Drivegフォルダへのパスを求める(com~apple~CloudDocs フォルダ)
set iCloudPath to ((path to library folder from user domain as string)) & "Mobile Documents:com~apple~CloudDocs"
tell application "Finder"
  make new Finder window
  
set target of Finder window 1 to (iCloudPath as alias)
end tell

★Click Here to Open This Script 

これは、~/Library/iCloud Drive/com~apple~CloudDocsをオープンするものですが、これを実行すると、

となります。

Terminal上で当該フォルダを表示させてフォルダ名を再度確認してみたところ、きっとこれです。

Posted in File path System | Tagged 10.11savvy 10.12savvy Finder | Leave a comment

Stickiesからのデータ取り出し v2

Posted on 9月 6, 2018 by Takaaki Naganoya

スティッキーズ(Stickies.app)のデータをまとめて引っこ抜いてListに入れるAppleScriptです。色情報、1行目の内容をタイトルとみなしてタイトル情報も付加して出力するようにしてみました。

オープンソースのStickiesViewerをFramework化したstickiesLib.frameworkを経由してデータを読み出します。データベースファイルから情報を直接読み取るので、Stickies.appが起動している必要はありません。

–> Download stickiesLib.framework(To ~/Library/Frameworks/)

–> {creationDate:date “2006年1月15日日曜日 11:02:32″, aTitle:”WX-310Kの画像サイズ”, modificationDate:date “2006年1月15日日曜日 11:03:09″, aContents:”WX-310Kの画像サイズ
ケータイ:120×160
壁紙:240×320″, colorName:”Yellow”}

StickiesDatabaseからまとめて一括で全部抽出するので、個別に何かのIDで指定して抽出するといった動作にはなりません。

93個のスティッキーズ書類(93個のウィンドウが表示されている状態、1つのDBを指定)から、全データを取得して本AppleScriptで0.1秒程度です。

AppleScript名:Stickiesからのデータ取り出し v2.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/09/05
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.5" — El Capitan (10.11) or later
use framework "Foundation"
use framework "AppKit"
use framework "stickiesLib"
use scripting additions

property NSColor : a reference to current application’s NSColor
property |NSURL| : a reference to current application’s |NSURL|
property SVReader : a reference to current application’s SVReader
property NSFileManager : a reference to current application’s NSFileManager
property NSMutableArray : a reference to current application’s NSMutableArray

set sRes to retStickiesData() of me
–>
(*
{{creationDate:date "2006年1月15日日曜日 11:02:32", aTitle:"WX-310Kの画像サイズ", modificationDate:date "2006年1月15日日曜日 11:03:09", aContents:"WX-310Kの画像サイズ
ケータイ:120×160
壁紙:240×320", colorName:"Yellow"}, ….}
*)

on retStickiesData()
  set dbPath to POSIX path of (path to library folder from user domain) & "StickiesDatabase"
  
set aExt to (NSFileManager’s defaultManager()’s fileExistsAtPath:dbPath) as boolean
  
  
if aExt = false then
    set dbPath to POSIX path of (choose file with prompt "Select StickiesDatabase file")
  end if
  
  
set aURL to |NSURL|’s fileURLWithPath:dbPath
  
set aStickDB to SVReader’s notesWithContentsOfURL:aURL
  
  
set aList to aStickDB as list
  
  
–スティッキーズの色データ
  
set cList to {{"Yellow", {254, 244, 156}}, {"Blue", {173, 244, 255}}, {"Green", {178, 255, 161}}, {"Pink", {255, 199, 199}}, {"Purple", {182, 202, 255}}, {"Gray", {238, 238, 238}}}
  
  
  
set outArray to NSMutableArray’s new()
  
  
repeat with i in aList
    set anAttrStr to i’s attributedString()
    
set aStr to (anAttrStr’s |string|()) as string
    
    
set curTitle to first paragraph of aStr
    
    
set aColor to i’s |color|()
    
set cDate to i’s dateCreated() as date
    
set mDate to i’s dateModified() as date
    
    
set c1List to retColListFromNSColor(aColor, 255) of me
    
    
–Find Color Name
    
set hitF to false
    
repeat with ii in cList
      set {colName, colList} to ii
      
if c1List = colList then
        set hitF to true
        
exit repeat
      end if
    end repeat
    
    
if hitF = false then error "Color name did not hit"
    
    
set curName to colName
    (
outArray’s addObject:{creationDate:cDate, modificationDate:mDate, aContents:aStr, colorName:curName, aTitle:curTitle})
    
  end repeat
  
  
return outArray as list
end retStickiesData

on retColorFromRGBnum(r, g, b)
  return (NSColor’s colorWithCalibratedRed:r / 255.0 green:g / 255.0 blue:b / 255.0 alpha:1.0)
end retColorFromRGBnum

–NSColorからrgbの8bitの値を取り出す
on retColListFromNSColor(aCol, aMAX as integer)
  set aRed to round ((aCol’s redComponent()) * aMAX) rounding as taught in school
  
set aGreen to round ((aCol’s greenComponent()) * aMAX) rounding as taught in school
  
set aBlue to round ((aCol’s blueComponent()) * aMAX) rounding as taught in school
  
return {aRed, aGreen, aBlue}
end retColListFromNSColor

★Click Here to Open This Script 

Posted in Color File path RTF System | Tagged 10.11savvy 10.12savvy 10.13savvy NSColor NSFileManager NSMutableArray NSURL Stickies | Leave a comment

Stickiesからのデータ取り出し

Posted on 9月 5, 2018 by Takaaki Naganoya

スティッキーズ(Stickies.app)のデータをまとめて引っこ抜いてListに入れるAppleScriptです。

オープンソースのStickiesViewerをFramework化したstickiesLib.frameworkを経由してデータを読み出します。データベースファイルから情報を直接読み取るので、Stickeys.appが起動している必要はありません。

–> Download stickiesLib.framework(To ~/Library/Frameworks/)

昔はいろいろ苦労したような気がするのですが、あっさりデータを取り出せて驚きます。

色情報も取り出していますが、色名を取り出すにはややScriptがおおげさになるので、とりあえず作成日、修正日、テキストを取り出してみました。

AppleScript名:Stickiesからのデータ取り出し v1.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2018/09/05
—
–  Copyright © 2018 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4" — Yosemite (10.10) or later
use scripting additions
use framework "Foundation"
use framework "stickiesLib" –https://github.com/kainjow/StickiesViewer

set aFile to POSIX path of (choose file default location (path to library folder from user domain) with prompt "Select StickiesDatabase file")

set aURL to current application’s |NSURL|’s fileURLWithPath:aFile
set aList to (current application’s SVReader’s notesWithContentsOfURL:aURL) as list

set outList to {}

repeat with i in aList
  set anAttrStr to i’s attributedString()
  
set aStr to (anAttrStr’s |string|()) as string
  
  
set aColor to i’s |color|()
  
set cDate to i’s dateCreated() as date
  
set mDate to i’s dateModified() as date
  
  
set the end of outList to {creationDate:cDate, modificationDate:mDate, aContents:aStr}
end repeat

return outList

★Click Here to Open This Script 

Posted in RTF System | Tagged 10.11savvy 10.12savvy 10.13savvy NSURL Stickies | 3 Comments

SMCkitで各種センサー値を取得する

Posted on 9月 4, 2018 by Takaaki Naganoya

MCWrapperをCocoa Framework化してAppleScriptから呼びやすいように書き換えた「SMCKit.framework」を呼び出して、CPUの温度や放熱ファンの回転数を取得するAppleScriptのパラメータを追跡調査したものです。

最近、夏の暑さ対策のためにMacのファン回転を操作&各種センサー値を取得する「TG Pro」を使い始め、MacBook Proの下にCooling Fanを設置し、人間を冷やすためにサーキュレーター(「戦場の絆」のPOD内によく設置されている一品)を設置しています。


▲このプログラムを書いたころ、ちょうど鹿児島の海沿いの東向きの部屋にいたので、夏場は暑さで人間よりも先にコンピュータ(Mac)が音を上げていました(なつかしい) そして、桜島が噴火を起こすとドアとか窓ガラスが衝撃波でビリビリと震えていました。激しい噴火だと、ドアを蹴られたような音がするほど(海沿いだったもので)

ちょっと前までは、このサーキュレータでMacBook Proに送風していました。これだと人間が冷えなさすぎなので、近くのPC DepotでノートPC用のクーリングファンを買ってきた次第です。


▲TG Pro(左)、HWMonitor(右)

オープンソースのHWMonitor(HWSensorsに含まれる実行バイナリ)の中身を見てみたところ、SMCにはもっといろいろパラメータを指定できることがわかりました。ざっと調べて、その数493個!

ただし、実行するハードウェアの構成によって、取得できるセンサーも変わってきます。デスクトップ型のMac miniやMac Proに明度センサー(アンビエント・センサー)やバッテリー関連のセンサーはついていないですし(Mac Pro 2013には明度センサーが付いていたかもしれない)、ディスクリートGPUを搭載していないMacBook AirやMac miniでディスクリートGPU関連のセンサーから値を取ることはできません。

–> Download SMCKit.framework(To ~/Library/Frameworks/)

実際には、CPU/GPU関連の温度センサーの値だけ取得できれば、Cocoa呼び出しで高速に処理しすぎてCPUの温度が上がりすぎた、というケースにも対応できるはずです(警告を出すとかいった程度で、ファンの回転数を上げるといった処理はまだできていません)。

長時間、ファイルを大量に処理するような場合には、マシンの種別を取得して、ノートであればあらかじめ放熱に気をつけるようにメッセージを表示し、処理中にCPU温度が上がりすぎた場合には何らかの対策を行うといったところでしょうか(サーマルスロットリングが起こらない程度に様子を見る、とか?)。

AppleScript名:SMCkitで各種センサー値を取得する
— Created 2018-08-21 by Takaaki Naganoya
— 2018 Piyomaru Software
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "SMCKit" –https://github.com/FergusInLondon/SMCWrapper
–I turned the SMCWrapper into Cocoa Framework and change it to call from AppleScript

set smc to current application’s SMCWrapper’s sharedWrapper()

–CPU Proximity
set a0Res to (smc’s readKeyAsString:"TC0P") as string as number
–> 53.875 (℃)

–CPU
set a1Res to (smc’s readKeyAsString:"TCXC") as string as number
–> 69.984(℃)

–PECI SA
set a2Res to (smc’s readKeyAsString:"TCSA") as string as number
–> 68(℃)

–PECI GPU
set a3Res to (smc’s readKeyAsString:"TCGC") as string as number
–> 69(℃)

–PCH Die
set a4Res to (smc’s readKeyAsString:"TPCD") as string as number
–> 71(℃)

–Memory Module, Proximity
set a5Res to (smc’s readKeyAsString:"TM0P") as string as number
–> 56.75(℃)

–GPU Die
set a6Res to (smc’s readKeyAsString:"TG0D") as string as number
–> 65.375(℃)

–GPU Proximity
set a7Res to (smc’s readKeyAsString:"TG0P") as string as number
–> 59.5(℃)

–Airport Proximity
set a8Res to (smc’s readKeyAsString:"TW0P") as string as number
–> 52(℃)

–Battery
set a9Res to (smc’s readKeyAsString:"TB0T") as string as number
–> 38.699

–Battery
set a10Res to (smc’s readKeyAsString:"TB1T") as string as number
–> 38.699

–Battery
set a11Res to (smc’s readKeyAsString:"TB2T") as string as number
–> 36.5

–Heatpipe
set a12Res to (smc’s readKeyAsString:"Th1H") as string as number
–> 46.75(℃)

–Heatpipe Incoming Air
set a12Res to (smc’s readKeyAsString:"Ts0P") as string as number
–> 40(℃)

–CPU VRM
set a13Res to (smc’s readKeyAsString:"VC0C") as string as number
–> 0.86963

–CPU GFX
–set a13Res to (smc’s readKeyAsString:"VC0G") as list of string or string
–> 0.86963

–CPU Core
set a13Res to (smc’s readKeyAsString:"IC0C") as string as number
–> 13.57

–CPU Rail
set a14Res to (smc’s readKeyAsString:"IC0R") as string as number
–> 1.0586

–GPU
set a15Res to (smc’s readKeyAsString:"IG0C") as string as number
–> 7.898

–IM:021C|Memory Module %X
set a16Res to (smc’s readKeyAsString:"IM0C") as string as number
–> 0.3252

–Battery
–set a16Res to (smc’s readKeyAsString:"IBAC") as list of string or string
–> 0.3252

–Mainboard S0 Rail
set a17Res to (smc’s readKeyAsString:"ID0R") as string as number
–> 2.29321

–CPU Core
set a18Res to (smc’s readKeyAsString:"PC0C") as string as number
–> 10.39 (A)

–CPU Package Cores
set a18Res to (smc’s readKeyAsString:"PCPC") as string as number
–> 5.75 (W)

–CPU Package Graphics
set a18Res to (smc’s readKeyAsString:"PCPG") as string as number
–> 0.094

–CPU Package Total
set a19Res to (smc’s readKeyAsString:"PCPT") as string as number
–> 12.07 (W)

–PM:041C|Memory Module %X
set a20Res to (smc’s readKeyAsString:"PM0R") as string as number
–> 0.441

–Battery Rail
set a21Res to (smc’s readKeyAsString:"PBLC") as string as number
–> 0.012

–Mainboard S0 Rail
set a21Res to (smc’s readKeyAsString:"PC0R") as string as number
–> 14.617

–System Total
set a21Res to (smc’s readKeyAsString:"PSTR") as string as number
–> 41.234

★Click Here to Open This Script 

Posted in System | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

Post navigation

  • Older posts
  • Newer posts

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

Google Search

Popular posts

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

Tags

10.11savvy (1101) 10.12savvy (1242) 10.13savvy (1391) 10.14savvy (587) 10.15savvy (438) 11.0savvy (283) 12.0savvy (212) 13.0savvy (194) 14.0savvy (147) 15.0savvy (135) CotEditor (66) Finder (51) iTunes (19) 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) 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年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