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

タグ: Script Editor

Script Debuggerのかわり、別のものを考える

Posted on 1月 2 by Takaaki Naganoya

Script Debuggerという強力なプレイヤーがいるために、スクリプト作成のためのツールを企画しても製品を実現するのは大変でした。でも、SDがディスコンになると、従来いろいろ検討してきたアイデアを実現できるかもしれません。

タイプ1:Automatorのようにブロック部品をつなぐ記述アプリ

大量にAutomatorのアクションを用意して、つないでプログラムを組む環境を作ることを考えたことがありました。Automatorそのものに突っ込んでよかったのですが、Apple純正のアクションを削除する方法がわからなかったのと、一般ユーザーがAutomatorを2つぐらいのアクションしかつないで使っていないことが分かって、ちょっと難しそうだと判断しました。

タイプ2:記述支援機能マシマシなエディタ

コンテクストメニュー経由で大量の補助Scriptを呼び出すエディタタイプを企画していました。ただ、それって普通にスクリプトエディタに組み込めばいいじゃない? ということで、Piyomaruスクリプトアシスタントを充実させました。

タイプ3:テキストでやりたいことを入力するとコードを入力するエディタ

ChatGPTみたいに、文章からコードを生成するエディタ。ありもののScriptライブラリを呼び出すタイプ。
LLMに各プログラムをどのように学習させられるかが不明。アイデアだけは検討してきた内容。

Posted in news | Tagged Script Editor | Leave a comment

スクリプトエディタでFinderやスクリプトエディタ自身のAppleScript用語辞書をブラウズできない問題、解決か?

Posted on 11月 12, 2024 by Takaaki Naganoya

macOS 15.2 Beta(24C5079e)において、以前本BlogでレポートしていたスクリプトエディタでFinderやスクリプトエディタ自身のAppleScript用語辞書をオープンできない問題が解消されていることを確認しました。

ただし、本問題は再発する可能性が高いものと見ています。電子書籍「AppleScript最新リファレンス v2.8対応」のmacOS 15向けの改修を行なっていますが、

「macOS 15でFinderのAppleScript用語辞書を閲覧できない件」についての対処方法の追加記事が無駄になったことは、喜ばしいことなのでしょうか。きっと、再現して必要になるのでは? と思っているものです。

スクリプトエディタのコンテクストメニューに、絵文字を使ったファイル名のAppleScriptやフォルダが複数回表示されるバグの場合にも、Betaで修正を知らされてもRelease版では直っていなかったため、複数プロジェクト間で矛盾した設定や処理が行われていること自体が解消されてこなかったのでしょう。

Appleの会社組織が極度に縦割り化されているため、チーム間の連携とかチーム間にまたがる問題がいっこうに解決されないといった問題が発生しており、Aチームで修正を行っても他のBチームやCチームでは以前どおりの処理を行なってAチームの修正が無駄になるといった話を散々目撃してきました。

Posted in Bug | Tagged 15.0savvy Script Editor | Leave a comment

macOS 15:スクリプトエディタのAppleScript用語辞書を確認できない

Posted on 10月 25, 2024 by Takaaki Naganoya

macOS 15になって、起動中のアプリ自身が自分のバンドル内のリソースにファイルアクセスできなくなったためか(仮説)、スクリプトエディタで自身のAppleScript用語辞書を確認できていません(macOS 15.1)。

用語辞書を読まずにAppleScriptを書くことはできないので、従来のmacOS 13や14から比べると「困った改変」です。

一応、Script Debuggerを用いてスクリプトエディタのAppleScript用語辞書をブラウズすることは可能であるため、不可能になったわけではないのですが、スクリプトエディタで用語辞書をオープンできないと、辞書内容をファイル保存して、変更点の差分を検出できなくて(私が)困っています。

スクリプトエディタのAppleScript用語辞書は、バンドル内にsdefの形式で格納されなくなったため(.scriptsuites書類?)バンドルの中身を開けてコピーというFinderのような解決策をとることができません。

Posted in Bug sdef | Tagged 15.0savvy Script Editor | 2 Comments

macOS 15:スクリプトエディタでFinderのAppleScript用語辞書が閲覧できない

Posted on 10月 18, 2024 by Takaaki Naganoya

Betaのときには起こっていなかった現象で、macOS 15.1で確認されています。

スクリプトエディタでFinderのAppleScript用語辞書を閲覧できません。

Finderは/System/Library/CoreServicesフォルダに入っており、このフォルダへのアクセスが「より厳しく」なったのでしょう。

ただ、実際にFinderがAppleScript対応しなくなったわけでもなければ、FinderのSDEFが除去されたわけでもありません。

実際にFinderの(パッケージ内容をコンテクストメニューから表示させたうえで)SDEFをコピーして、コピーしたものをスクリプトエディタで閲覧するとよいでしょう。

Posted in Bug | Tagged 15.0savvy Finder Script Editor | Leave a comment

指定Bundle IDのアプリのsdefを指定フォルダに取り出す

Posted on 6月 27, 2024 by Takaaki Naganoya

新しいOSのベータ版や、古いOS環境のAppleScript用語辞書をまとめて取り出すために作成したAppleScriptです。

アプリケーションのバンドル内から直接sdefを取り出すと、他の要素を外部からincludeしているsdefでは「完全体」にならない(資料として価値がなくなる)ため、Script Editorで表示(レンダリング)させた状態のものをコピーするよう処理しています。

以前にもこうした種類のScriptを書いていたような気もするのですが、どこかに行ってしまいました。

macOSのバージョン、ビルドNo.などを取得し、コピーしたSDEFファイルに対象アプリのバージョン番号ともども記載するようにしています。

本Scriptはスクリプトエディタを操作するものであるため、Script Debuggerなどの他の実行プログラムから実行することが望ましいところです。

そして、macOS 15.0beta2でもScript Debuggerが起動しないため、肝心のmacOS 15Betaでsdef書き出しを自動化できていないという………

AppleScript名:指定Bundle IDのアプリのsdefを指定フォルダに取り出す.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2024/06/27
—
–  Copyright © 2024 Piyomaru Software, All Rights Reserved
—
use AppleScript
use scripting additions
use framework "Foundation"
use framework "AppKit"

set aList to {"com.apple.iCal", "com.apple.AddressBook", "com.apple.databaseevents", "com.apple.finder", "com.apple.imageevents", "com.apple.mail", "com.apple.MobileSMS", "com.apple.Music", "com.apple.Notes", "com.apple.Photos", "com.apple.QuickTimePlayerX", "com.apple.reminders", "com.apple.Safari", "com.apple.ScriptEditor2", "com.apple.speech.SpeechRecognitionServer", "com.apple.systemevents", "com.apple.Terminal", "com.apple.TextEdit", "com.apple.TV", "com.apple.systempreferences"}

set targFol to POSIX path of (choose folder with prompt "SDEF収集先フォルダを選択")

–Get OS Version and Build Number
set sDic to current application’s NSDictionary’s dictionaryWithContentsOfFile:"/System/Library/CoreServices/SystemVersion.plist"
set osV to (sDic’s objectForKey:"ProductVersion") as string
set bNo to (sDic’s objectForKey:"ProductBuildVersion") as string

–Loop by Bundle IDs
repeat with i in aList
  set j to contents of i
  
set aRes to retPathFromBundleID(j) of me
  
set appAlias to (POSIX file aRes) as alias
  
  
set vRes to gepAppVersionByID(j) of me
  
  
tell application "Script Editor"
    open appAlias –Open App –> SDEF will be displayed
    
    
tell front document
      set docPath to path of it
    end tell
  end tell
  
  
do shell script "sync" –Important!!!!
  
  
set aP1 to (current application’s NSString’s stringWithString:(docPath as string))
  
set theName to aP1’s lastPathComponent()
  
set aP2 to (current application’s NSString’s stringWithString:targFol)
  
set newPath to (aP2’s stringByAppendingPathComponent:theName)
  
set aExt to (newPath’s pathExtension()) as string
  
set newPath to (newPath’s stringByDeletingPathExtension() as string) & "_v" & vRes & "@" & osV & "(" & bNo & ")." & aExt
  
  
–Copy SDEF file
  
set aRes to (my copyFileAt:aP1 toFilePath:newPath)
  
  
–Close SDEF
  
tell application "Script Editor"
    tell front document
      close without saving
    end tell
  end tell
  
end repeat

–バンドルIDからApp Fileのパスを求める
on retPathFromBundleID(aBundleID)
  set aURL to current application’s NSWorkspace’s sharedWorkspace()’s URLForApplicationWithBundleIdentifier:aBundleID
  
if aURL = missing value then return false –Error
  
return aURL’s |path|() as string
end retPathFromBundleID

–ファイルのコピー
on copyFileAt:origPOSIXPath toFilePath:newPOSIXPath
  set POSIXPath1 to current application’s NSString’s stringWithString:origPOSIXPath
  
set POSIXPath2 to current application’s NSString’s stringWithString:newPOSIXPath
  
set fileManager to current application’s NSFileManager’s defaultManager()
  
set theResult to fileManager’s copyItemAtPath:POSIXPath1 toPath:POSIXPath2 |error|:(missing value)
  
return (theResult as integer = 1)
end copyFileAt:toFilePath:

–バンドルIDで指定したアプリケーションのバージョン番号を文字列で取得する
on gepAppVersionByID(aBundleID)
  
  
set aURL to current application’s NSWorkspace’s sharedWorkspace()’s URLForApplicationWithBundleIdentifier:aBundleID
  
set theResult to {}
  
  
set theNSBundle to (current application’s NSBundle’s bundleWithURL:aURL)
  
  
if aURL is not missing value then
    set theVersionString to ((theNSBundle’s infoDictionary())’s objectForKey:"CFBundleShortVersionString")
    
    
if theVersionString is not missing value then
      return theVersionString as string
    end if
    
  end if
  
  
return ""
end gepAppVersionByID

★Click Here to Open This Script 

Posted in file sdef | Tagged 13.0savvy 14.0savvy 15.0savvy Script Editor | Leave a comment

スクリプトエディタで記入した「説明」欄の内容が消えるバグ

Posted on 1月 9, 2024 by Takaaki Naganoya

macOS 13.6.4+スクリプトエディタ バージョン2.11 (229)の組み合わせで、AppleScript書類の「説明」欄に記入した内容が「消える」トラブルが発生しています。macOS 14上でも発生していることを確認しました。


▲スクリプトエディタ上で新規書類を作成して、AppleScript本文と「説明」欄の内容を書き込んでみた


▲スクリプトエディタで名称を指定して保存(.scpt形式)した状態


▲保存していったんクローズして、再度オープンしてみたところ。「説明」欄の内容が見えない


▲「説明」欄の内容を選択したところ。白い色の文字が存在していることがわかる

「消える」というよりは、「見えなくなる」というのが正しい状況と思われますが、macOSのマイナーアップデートでこうした変更が加わる(正確にいえば、APIなどの変更が行われた一方で、スクリプトエディタの修正が行われずに動作がおかしくなる)というのは納得できません。

なお、バンドル形式のAppleScript(.scptd形式)であれば、「説明」欄の内容が白く表示されることはないようです。

Posted in Bug | Tagged 13.0savvy 14.0savvy Script Editor | 1 Comment

Finder上で選択中のASバンドル書類をオープンしてscpt形式で再保存

Posted on 10月 20, 2023 by Takaaki Naganoya

Finder上で選択中のAppleScriptバンドル形式書類をスクリプトエディタでオープンして、scpt形式で保存し直すAppleScriptです。

スクリプトエディタのコンテクストメニューが.scpt形式しか認識しないので、バンドル形式のScriptを変換するために作ったものです。

Finderの選択中のファイルをフィルタするのに、フィルタ参照ではなくUTIを求めて判定しています。

「AppleScript最新リファレンスv2.8対応」の付録Scriptの加工用に作ったものです。バンドル形式への変換は書いてあったものの、scpt形式に変換するものは書いていなかったので急遽、用意しました。

AppleScript名:Finder上で選択中のASバンドル書類をオープンしてscpt形式で再保存.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2023/10/20
—
–  Copyright © 2023 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

property |NSURL| : a reference to current application’s |NSURL|
property NSArray : a reference to current application’s NSArray
property NSPredicate : a reference to current application’s NSPredicate
property NSURLTypeIdentifierKey : a reference to current application’s NSURLTypeIdentifierKey

on run
  set aResList to main("com.apple.applescript.script-bundle") of me
  
  
set ngList to {}
  
  
repeat with i in aResList
    set anAlias to contents of i
    
set aRes to saveAppleScriptAsScript(anAlias) of me
    
    
if aRes = false then
      set the end of ngList to contents of i
    end if
  end repeat
  
  
return ngList
end run

–scptdファイルをaliasで渡すと、scptファイルで同じ場所に保存し直す
on saveAppleScriptAsScript(aFile)
  set dPOSIX to POSIX path of aFile
  
if dPOSIX ends with "/" then
    set dPOSIX to (strings 1 thru -2 of dPOSIX)
  end if
  
  
–フルパスから、拡張子を付け替える
  
set newPath to changeExtFromPath(dPOSIX, "scpt") of me
  
set newFile to POSIX file newPath
  
  
tell application id "com.apple.scripteditor2"
    try
      open aFile
      
      
tell front document
        check syntax
      end tell
      
      
save front document as "script" in file newFile
      
close front document without saving
      
return true
    on error
      return false
    end try
    
  end tell
end saveAppleScriptAsScript

–POSIX pathの拡張子を付け替える
on changeExtFromPath(aPath, newExt)
  set pathString to current application’s NSString’s stringWithString:aPath
  
set newPath to ((pathString’s stringByDeletingPathExtension())’s stringByAppendingPathExtension:newExt) as string
  
return newPath
end changeExtFromPath

on main(acceptUTI)
  tell application "Finder"
    set aSel to selection as alias list
  end tell
  
  
set aList to {}
  
  
repeat with i in aSel
    set anAlias to contents of i
    
set aUTI to getUTIfromPath(anAlias) of me
    
if aUTI is not equal to missing value then
      set uRes to filterUTIList({aUTI}, acceptUTI) of me
      
      
if uRes is not equal to {} then
        set the end of aList to contents of i
      end if
    end if
  end repeat
  
  
return aList
end main

–AliasからUTIを求める
on getUTIfromPath(anAlias)
  set aPOSIXpath to POSIX path of anAlias
  
set aURL to current application’s |NSURL|’s fileURLWithPath:aPOSIXpath
  
if aURL = missing value then return missing value
  
set aRes to aURL’s resourceValuesForKeys:{current application’s NSURLTypeIdentifierKey} |error|:(missing value)
  
if aRes = missing value then return missing value
  
return (aRes’s NSURLTypeIdentifierKey) as string
end getUTIfromPath

–UTIリストが指定UTIに含まれているかどうか演算を行う
on filterUTIList(aUTIList, aUTIstr)
  set anArray to NSArray’s arrayWithArray:aUTIList
  
set aPred to NSPredicate’s predicateWithFormat_("SELF UTI-CONFORMS-TO %@", aUTIstr)
  
set bRes to (anArray’s filteredArrayUsingPredicate:aPred) as list
  
return bRes
end filterUTIList

★Click Here to Open This Script 

Posted in file File path filter | Tagged 12.0savvy 13.0savvy 14.0savvy Finder Script Editor | Leave a comment

macOS 13:スクリプトエディタで、テンプレートから新規作成した書類を破棄も保存もできない

Posted on 11月 22, 2022 by Takaaki Naganoya

macOS 13.1Betaで地味でうっとおしく、わずらわしく嫌がらせとしか思えないバグが1つ。スクリプトエディタでテンプレートから新規作成したAppleScriptが、ファイル保存も破棄もできない状態になっています。

普通に新規作成したScriptも、デフォルトでiCloud Driveに自動保存され、破棄できなかったのでiCloud Drive上のファイルを削除したら、スクリプトエディタ上の名称未設定書類を破棄できるようになりました。

作業するたびに画面上に保存も破棄もクローズもできないゾンビ状態のスクリプトエディタ書類がたまっていくのですが、これはどういう検証をしたらこういう状態になるんだか。

保存も破棄もできないスクリプトエディタ書類をGUI側からいろいろ確認してみたところ、デフォルトの保存先が「アプリケーション」フォルダになっており、それで一時ファイルも作れず、保存もできない状態になっているようです。

もう少し試して、デフォルト保存先を「アプリケーション」以外のユーザーディレクトリのどこか(デスクトップとか)に指定したら、複数あったゾンビ書類は破棄できるものも出てきたのですが、このデフォルト保存先フォルダをいろいろいじくらないと破棄できないとかいうのは、正直ダメすぎる動作だと思います。

Posted in Bug | Tagged 13.0savvy Script Editor | Leave a comment

スクリプトエディタにAS的な脆弱性、実行専用で書き出したScriptの「プレビュー」にソース情報残る

Posted on 7月 19, 2022 by Takaaki Naganoya

macOS 12.5上のスクリプトエディタで、バンドル形式のAppleScript書類を「実行専用」で書き出してみたところ、Finderのファイルプレビューで中身が見えますね(^ー^;;;

これを脆弱性と言わずに何と言うのだろーか? Apple純正のスクリプトエディタで「実行専用」で書き出すと、Finderプレビューで内容が読めてしまうというのは。

重要なScriptについては、Script Debuggerで書き出すことをおすすめします。


▲スクリプトエディタで内容を読めない「実行専用」形式で書き出した書類なのに、Finderプレビューでソース情報が見える

Posted in Bug | Tagged 12.0savvy Script Editor | Leave a comment

macOS 12.5RC(21G69)、一定以上の長さのapplescript:// URL Linkを受け付けない???

Posted on 7月 14, 2022 by Takaaki Naganoya

毎回毎回、何かかしら嫌がらせをブチ込んでくるmacOS 12.5シリーズ、RC(21G69)で「applescript://」Custom URL Linkが一定以上の長さになると無視されることが判明しました。

これは、本Blogなどに掲載しているURLリンク入りのプログラムリストの機能を無効にするものです。

この動作は、macOS 10.15のPDFViewで行った嫌がらせと同じ仕様です。さんざん文句を言ったところ、Preview.app上でのURLイベントクリックについてはStop、他のアプリケーションのWindow上のPDFViewについては嫌がらせをしなくなったという経緯があります。

自分も本件はAppleにバグレポートしますが、Appleはレポート件数で重要かそうでないか判断するので、本Blogをご覧の方々にもAppleへのレポートをお願いしたいところです。

–> Demo Movie of macOS 12.5RC applescript:// URL Link ignorance

Posted in Bug | Tagged Safari Script Editor | 4 Comments

新発売:AppleScript基礎テクニック集(16)スクリプトエディタの使い方

Posted on 6月 28, 2022 by Takaaki Naganoya

電子書籍の新刊を発売しました。新シリーズ「AppleScript基礎テクニック集」の第16巻、「スクリプトエディタの使い方」です。PDF 38ページ、付録AppleScriptのZipアーカイブを添付。

→ 販売ページ

スクリプトエディタは、Classic Mac OSのスクリプト編集プログラムをAppleがMac OS Xに移植したものです。

初期にはCarbonベースで書かれ、v10.4でCocoa&Universal Binary化、v10.6で64bit化。v11でApple Silicon/Intel 64のUniversal Binary化と、Mac上のすべての移行を経験してきた猛者です。

原始時代のスクリプト編集プログラムには、検索機能すら実装されておらず、Script Debuggerとの差は明白でした(仕事で使うならScript Debuggerが必要、という状況はいまでも変わりません)。

そんなスクリプトエディタも、Mac OS X 10.4で32Kバイト以上のスクリプトが編集可能になり、AppleScriptからのコントロールが行えるようになったことで、「使える道具」になってきました。

同時にURLイベントに対応したことで、筆者のBlog「AppleScriptの穴」掲載の、リンクのクリックで内容が転送されるプログラムリストをWeb上で共有できるようにもなりました。

本書を通してご覧になると、「これは拾い物!」「こんなの知らなかった!」というスクリプトエディタの機能が見つかることでしょう。

本書付録には、スクリプトエディタのコンテクストメニューから起動するスクリプト記述支援AppleScript集「Piyomaru Script Assistant v2.1」、各種macOS標準搭載アプリケーション用のテンプレートAppleScript集を添付。

さまざまな角度から、スクリプト記述のための生産性を向上させる仕組みを提供しています。

目次:

■編集環境としてのスクリプトエディタ

スクリプトエディタの機能一覧
スクリプト新規作成/テンプレートからの作成
ユーザー用Scriptテンプレートの追加方法
Cocoa-AppleScriptアプレットの新規作成
URLイベント受信
短縮入力の展開
「説明」欄の編集
構文書式設定
コンパイル(構文確認)
バンドル内ファイル編集
Info.plist編集
スクリプトアシスタント入力
ヘルプの閲覧
AppleScriptからの操作
新規作成スクリプトのデフォルトウィンドウ指定
その他の機能

■実行・デバッグ環境としてのスクリプトエディタ

AppleScriptの実行環境における位置付け
実行/強制メインスレッド実行
ログ表示/履歴管理
スクリプトメニューの有効化/無効化

■用語辞書閲覧環境としてのスクリプトエディタ

用語辞書の閲覧
ライブラリ管理

■保存、書き出し環境としてのスクリプトエディタ

スクリプト保存
スクリプト書き出し/コード署名

Posted in Books news | Tagged 10.15savvy 11.0savvy 12.0savvy Script Editor | Leave a comment

AS Publisher v18–> v19

Posted on 11月 7, 2021 by Takaaki Naganoya

とくに新しいわけでもなんでもありませんが、「スクリプトエディタでオープン中のScriptをリンクつきのHTMLとして書き出すAppleScript」である「AS Publisher」の機能改修版です。前バージョンまではURLエンコーディング処理にpythonを呼び出して処理していましたが、Cocoaの機能を呼び出すように書き換えました。

# v18に処理のミスがあり、そのミスがOS側で「こういう間違いが多いから通しておこう」と見逃されていたのが厳密に処理されるようになったため、ミスの部分を修正しておきました

AppleScriptのリストをBlogなどに掲載する場合、WordPressやMarkdownの構文自動認識フォーマットを使って掲載されているものを見かけますが、そもそも「return return」(改行コードを返す)といった記述が許可されており、それらがきちんと構文色分けされているAppleScriptにおいて、単なるキーワードによる構文自動認識フォーマットが役立つわけがありません(知らずによく実装したもんですわ>オリジナル版を作った人)。

それ以前に「必要があったので」作ったAppleScriptでもあります。手元に残っている最古のバージョンは2005年の4月1日のタイムスタンプになっていますが、おそらくそれ以前から作っていたものでしょう。

# retMacOSpathList ハンドラで、ファイルパスをやたらとCastしている箇所がありますが、Mac OS X 10.5より前のAppleScriptではファイルパスの文字列のエンコーディングに問題を抱えていた(AppleScript側の文字列とのエンコーディング/ノーマライズの不整合)ので、その対策です。ただし、不必要なぐらい無駄な処理をしているので、参考にはなりません。Mac OS X初期の試行錯誤を強いられていた時代の遺物とでも思ってください

本Scriptおよびその派生版は、macOS標準装備のScript Menuに入れて実行することを想定しています。AppleScriptからスクリプトエディタを操作する場合に、Mac OS X 10.4の時代ではあまり動作が安定せず、もう少し後のバージョンのOSになるまで(10.5ぐらい?)、たいへんスリリングな(クラッシュが頻発する)Scriptingを強いられていました。

いまはそのあたりは安定していますが、ごく初期においては挙動が怪しい部分があったということです(その時期で知識が止まっている人はそういう認識のまま)。

話を戻しましょう。

AppleScriptのプログラムをBlogなどに掲載する際に、自分はこういう道具を作って使用しています。巨大なリストを掲載する場合には記事の文字数が膨大になってしまい、掲載をあきらめたこともありましたが、ほんのごく一部です。

このScriptをもとに、自分が使いやすいように(色指定とか)変更してみてもよいでしょう。

「動けばいい」ぐらいの割り切りで、秘伝のタレに継ぎ足してメンテナンスしてきましたが、HTMLタグで書式制御するよりはCSSで制御したほうがシンプルにできてよさそうな感じもします。

ファイル処理も、とくに「ここまでやる必要ってあったっけ?」という感想を持ってしまいます。なにぶん、2006年ごろに作ったものなので、自分で自分のプログラムを見ても違和感がものすごいですね。「OSの処理に対する不信感」がそこかしこに漂っています、、、、

AppleScript名:AS Publisher v19.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2014/11/09
–  Modified on: 2021/11/07
—
–  Copyright © 2006-2021 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

property quotChar : string id 34

property headerCol : "0000CC" –"0000CC" –ヘッダー部分(濃い色)
property bodyBackCol : "EEFFFF" –"EEFFFF" –Script本文下地(薄い色)
property footerCol : "66FFFF" –"66FFFF" –スクリプトリンク部分

set a to path to me

set pName to "com.apple.ScriptEditor2"

using terms from application "Script Editor"
  tell application id pName
    if (count every document) = 0 then
      display dialog "スクリプトをエディタでオープンした状態で実行してください。" buttons {"OK"} default button 1 with icon 1
      
return
    end if
    
    
set aP to path of front document
    
if aP = "" then
      display dialog "スクリプトを保存してから実行してください。" buttons {"OK"} default button 1 with icon 1
      
return
    end if
    
    
tell front document
      set aInfo to properties
      
set curLang to name of language of aInfo –現在のOSA言語の名称を取得する
    end tell
    
    
–OSA Language名称をもとに色セットを変更する
    
changeColor(curLang) of me
    
    
set c to name of front document
    
    
set aF to retMacOSpathList(aP) of me
    
set htmlFilePath to retHTMLpath(aF) of me
    
    
set contText to contents of front document
    
set encText to makeEncodedScript(contText) of me
    
    
set newLinkText to "applescript://com.apple.scripteditor?action=new&script=" & encText
    
–set insLinkText to "applescript://com.apple.scripteditor?action=insert&script=" & encText
    
–set apndLinkText to "applescript://com.apple.scripteditor?action=append&script=" & encText
    
    
set comText to description of front document
    
    
set textList to every attribute run of front document
    
set textList_ref to a reference to textList
    
    
set colorList to color of every attribute run of front document
    
set colorList_ref to a reference to colorList
    
    
set aTest to contents of item 2 of textList
    
set asciiTest to id of aTest
  end tell
end using terms from

set tabChar to string id 9

–set TIDsList to {{"&", "&amp;"}, {">", "&gt;"}, {"<", "&lt;"}, {"¥"", "&quot;"}}
set TIDsList to {{"\\", "\"}, {"’", "’"}, {"&", "&amp;"}, {">", "&gt;"}, {"<", "&lt;"}, {"  ", "  "}, {string id 13, string id 10}, {string id 13, "<br>"}, {string id 10, "<br>"}, {"\"", "&quot;"}}
–set TIDsList to {{"&", "&amp;"}, {">", "&gt;"}, {"<", "&lt;"}, {"¥"", "&quot;"}}

set TIDsList_ref to a reference to TIDsList

set dataOut to {}
set dataOut_ref to a reference to dataOut

set iCounter to 1
repeat with i in textList_ref
  set j to contents of i
  
  
set curDelim to AppleScript’s text item delimiters
  
repeat with eachItem in TIDsList_ref
    set AppleScript’s text item delimiters to contents of item 1 of eachItem
    
set j to every text item of j
    
set AppleScript’s text item delimiters to contents of item 2 of eachItem
    
set j to j as string
  end repeat
  
set AppleScript’s text item delimiters to curDelim
  
  
set cText to RBG2HTML(item iCounter of colorList_ref) of me
  
  
set the end of dataOut_ref to "<font color=" & cText & ">" & j & "</font>"
  
set iCounter to iCounter + 1
end repeat

set htmlHeader to "<table width=" & quotChar & "100%" & quotChar & " border=" & quotChar & "0" & quotChar & "cellspacing=" & quotChar & "2" & quotChar & " cellpadding=" & quotChar & "2" & quotChar & ">
<tr>
<td bgcolor=\"#" & headerCol & "\"><font color=" & quotChar & "#FFFFFF" & quotChar & ">" & curLang & "名:" & c

if comText is not equal to "" then
  set comText to "<br><font size=" & quotChar & "2" & quotChar & ">【コメント】 " & comText & "</font><br>"
end if

set htmlHeader2 to "</font></td>
</tr>
<tr>
<td bgcolor=\"#" & bodyBackCol & "\"><font size=\"3\">"

set htmlFooter1 to "</font></td>
</tr>
<tr>
<td bgcolor=\"#" & footerCol & "\"><p><font size=\"2\"><a href=\"" & newLinkText & "\">★Click Here to Open This Script</a> </font></p>
</td>
</tr>
</table>
"

set dataText to htmlHeader & comText & htmlHeader2 & (dataOut as text) & htmlFooter1
set dataText to dataText as Unicode text

–set dDir to (path to desktop as text) & "index.html"
–write_to_file(dataText, htmlFilePath, false) of me
–saveInEncoding(dataText, htmlFilePath, "UTF8") of me –UTF8
write_to_file_Safely(dataText, htmlFilePath) of me

tell application id "com.apple.ScriptEditor2"
  display dialog "HTML書き出し完了" buttons {"OK"} default button 1 with icon 1 giving up after 1
  
return
end tell

on retHTMLpath(aF)
  tell application "Finder"
    –set aF to retMacOSpathList(aP) of me
    
set afA to aF as alias
    
set aInfo to info for afA
    
set aExt to name extension of afA
    
    
set aFileName to name of afA
    
set aFileName to aFileName as text
    
set aFileName to aFileName as Unicode text
    
    
set aFileName_rev to reverse of (every character of aFileName) as text
    
set parentF to ((parent of afA) as alias) as text
    
set htmlFileName to name of afA
    
set htmlFileName to htmlFileName as text
    
set htmlFileName to htmlFileName as Unicode text
    
    
    
if aExt is not equal to "" then
      set htmlFileNameText to ((reverse of (items ((length of aExt) + 2) thru -1 of aFileName_rev)) as text) & ".html"
    else
      set htmlFileNameText to (aFileName as text) & ".html"
    end if
    
set htmlFileNameFullPath to parentF & htmlFileNameText
  end tell
  
return htmlFileNameFullPath
end retHTMLpath

on makeEncodedScript(contText)
  (*

  set aList to every paragraph of contText
  set aClass to class of aList
  if aClass = list then
    set aLen to length of aList
  else
    set aLen to 1
  end if
  
  set aaList to {}
  
  set delim to AppleScript’s text item delimiters
  set AppleScript’s text item delimiters to "//piyomaru_replacement_temp//"
  set bList to aList as text
  set AppleScript’s text item delimiters to delim
  
  set aaList to (encodeURL(bList) of me) as Unicode text
  
  set search_string to "//piyomaru_replacement_temp//" as Unicode text
  set replacement_string to "%0A" as Unicode text
set bList to replace_chars(aaList, search_string, replacement_string) of me
*)

  
  
set aaList to (encodeURL(contText) of me) as Unicode text
  
  
return aaList
end makeEncodedScript

–RGB値からHTMLの色指定に変換
on RBG2HTML(RGB_values)
  — NOTE: this sub-routine expects the RBG values to be from 0 to 65536
  
set the hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
  
set the the hex_value to ""
  
repeat with i from 1 to the count of the RGB_values
    set this_value to (item i of the RGB_values) div 256
    
if this_value is 256 then set this_value to 255
    
set x to item ((this_value div 16) + 1) of the hex_list
    
set y to item (((this_value / 16 mod 1) * 16) + 1) of the hex_list
    
set the hex_value to (the hex_value & x & y) as string
  end repeat
  
return ("#" & the hex_value) as string
end RBG2HTML

–安全なファイルの書き出し
on write_to_file_Safely(this_data, target_file)
  tell current application
    set finalPath to target_file
    
    
–テンポラリフォルダに一度書き出して、ターゲットのパスに移動  
    
set tmpFol to path to temporary items from system domain
    
set tmpName to do shell script "date +%Y%m%d%H%M%S"
    
set tmpPath to (tmpFol as string) & tmpName
    
    
–テンポラリのパスにファイル書き出し
    
try
      set the target_file to the tmpPath as text
      
set this_data to this_data as Unicode text
      
      
set the open_target_file to open for access file target_file with write permission
      
set eof of the open_target_file to 0 –つねにoverwrite mode(appendではなくて)
      
write this_data to the open_target_file starting at eof as «class utf8»
      
close access the open_target_file
      
    on error error_message
      try
        close access file target_file
      end try
      
return error_message
    end try
    
    
–ファイルの移動を行う
    
set tFilePOSIX to quoted form of POSIX path of target_file
    
set fPathPOSIX to quoted form of POSIX path of finalPath
    
set sText to "mv " & tFilePOSIX & " " & fPathPOSIX
    
try
      do shell script sText
    on error error_message
      return error_message
    end try
    
    
return true
  end tell
end write_to_file_Safely

on replace_chars(this_text, search_string, replacement_string)
  set AppleScript’s text item delimiters to the search_string
  
set the item_list to every text item of this_text
  
set AppleScript’s text item delimiters to the replacement_string
  
set this_text to the item_list as string
  
set AppleScript’s text item delimiters to ""
  
return this_text
end replace_chars

on encodeURL(origStr as string)
  set aStr to current application’s NSString’s stringWithString:origStr
  
set encodedStr to aStr’s stringByAddingPercentEncodingWithAllowedCharacters:(current application’s NSCharacterSet’s alphanumericCharacterSet())
  
return encodedStr as string
end encodeURL

on retMacOSpathList(aFile)
  set aPath to POSIX file aFile
  
set aPath to aPath as alias
  
set aPath to aPath as string
  
set aPath to aPath as Unicode text
  
set aliasFileList to aPath
  
return aliasFileList
end retMacOSpathList

–ファイルの追記ルーチン「write_to_file」
–追記データ、追記対象ファイル、boolean(trueで追記)
on write_to_file(this_data, target_file, append_data)
  tell current application
    try
      set the target_file to the target_file as text
      
set the open_target_file to open for access file target_file with write permission
      
if append_data is false then set eof of the open_target_file to 0
      
write this_data to the open_target_file starting at eof
      
close access the open_target_file
      
return true
    on error error_message
      try
        close access file target_file
      end try
      
return error_message
    end try
  end tell
end write_to_file

on changeColor(aLang)
  if aLang = "AppleScript" then
    set headerCol to "0000CC" –"0000CC" –ヘッダー部分(濃い色)
    
set bodyBackCol to "EEFFFF" –"EEFFFF" –Script本文下地(薄い色)
    
set footerCol to "66FFFF" –"66FFFF" –スクリプトリンク部分
    
  else if aLang = "JavaScript" then
    set headerCol to "804000" –"0000CC" –ヘッダー部分(濃い色)
    
set bodyBackCol to "E2D3D3" –"EEFFFF" –Script本文下地(薄い色)
    
set footerCol to "E7AC53" –"66FFFF" –スクリプトリンク部分
  end if
end changeColor

★Click Here to Open This Script 

Posted in OSA Text | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy Script Editor Script Menu | 15 Comments

AppleScriptを実行中のランタイムプログラム名を取得する

Posted on 1月 18, 2020 by Takaaki Naganoya

AppleScriptのランタイムプログラム名(ランタイム名)を取得するAppleScriptです。AppleScript自身が「何によって」実行されているか、その実行プログラム名を取得するものです。

AppleScriptには何種類かランタイム環境が存在し、ランタイム環境ごとに若干の動作が変わってくることが知られています。

ランタイム環境ごとにどこが違うといえば、Finderからのselectionを取得できるとかできないとか(AppleScript Studioがこれに該当。もうありませんけれども)、GUI Scriptingの権限の認証を得られるとか得られないとか。ウィンドウを動的に生成して表示したときに最前面に表示できるとかできないとか(Script Menuがこれに該当)。明示的にメインスレッドで実行する機能がないとか(Script Debuggerがこれに該当)。そういうところです(ほかにもあるかもしれない)。

過去に作ったAppleScriptを確認していたところ、プロセス名を取得するだけの使えないプログラムだと思っていたものが、実は「ランタイムプログラムのプログラム名」を取得できるというスゲーものであることを再発見しました。

ながらく、ランタイムプログラム名をAppleScript側から取得する必要性を感じていたため、この機会に調べてみることに。プログラム自体は些細な(↓)ものです。

AppleScript名:ランタイム環境名の表示
— Created 2015-09-08 by Takaaki Naganoya
— 2015 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set procInfo to current application’s NSProcessInfo’s processInfo()
set aName to procInfo’s processName() as string
display dialog aName

★Click Here to Open This Script 

Script Editor上で実行


–> “Script Editor”

Script Debugger上で実行


–> “Script Debugger”

ASObjC Explorer 4上で実行


–> “ASObjC Explorer 4”

Automator上で実行


–> “Automator”
これには驚きました。特別のランタイムプログラムが使われているのか、それとも単に親プロセスとしてのAutomatorが返ってきているのかは不明ですが、識別できるということには意義がありそうです。

Script Menu上で実行


–> “osascript”
これは、よく知られていることなのでとくに驚きはありません。テストを実施したのはmacOS 10.14.6上で、Script Menuは「スクリプトメニュー」という別アプリケーション(/System/Library/CoreServices/ にある)に変更になったOSバージョンですが、ランタイムにosascriptを使い続けていることを確認することになりました(それ以前のOSと挙動が同じなのでそうだと思っていましたけれども)。

Folder Action上で実行




–> “osascript”
Folder Actionは、macOS標準搭載のフォルダ監視機能です。監視対象のフォルダにファイルが追加されたり、移動されたり、フォルダそのものがオープンしたりするとその対象ファイル/フォルダで指定のAppleScriptを実行します。よく、ドラッグ&ドロップで処理を受け付けたり、ネットワーク経由でファイルを受信した場合にAppleScriptを実行するような使われ方をします。
Folder Action Disptcherが実行しているとばかり思っていたのですが、実際に確認したらosascriptでした。ちなみに、Folder ActionはmacOS 10.11でフルに書き換えられてそれ以前とは別物になっています。以前は数秒に一度対象フォルダをチェックする方式でしたが、10.11以降はFSEventsを利用して随時監視対象フォルダへの変更を受け付けます。

Switch Control上で実行



–> “osascript”
障害者向けの機能としてmacOSに標準装備されている、フローティングパレットからAppleScriptを呼び出せる機能である「Switch Control」。手を使わずに操作したり、他のコントローラで操作するような標準的ではない使い方をサポートするための機構ですが、普通に普通の人が使っても役立ちます。 
Switch ControlでAppleScriptを実行する場合のランタイムプログラムはosascriptです。

CotEditor上で実行


–> “osascript”
これは、CotEditorのソースを読んで確認してありました。ここだけ割と手抜き実装ですが、それでも複数のOSA言語に対応できたりと機能的には悪くはありません。むしろ、osascript側のランタイム環境が他の環境よりも一段落ちることに問題が、、、、GUI Scriptingの権限を取得できないこととか、このCotEditorのメニューから実行するとREST APIが呼び出せないとか。同じosascript系でもScript Menuのほうが制約が少ないのは、おそらくアプリケーション自体に許可されている条件の違いによるものでしょう。

FileMaker Pro上でスクリプトステップ「AppleScriptを実行」を実行


–> “FileMaker Pro”
FileMaker Proはランタイムアプリケーションが廃止され、FileMaker Pro AdvancedもFileMaker Proに一本化されたので、v19以降はFileMaker Proは「FileMaker Pro」というランタイムのみでしょう。v19でもFileMaker Pro自体はSandbox化されていないため、微妙にセキュリティ上の制約が少ない=自由度の高いランタイム環境として残っていくことでしょう。

Script EditorからApplet書き出しして実行


–> “applet”
取得できたらいいなぐらいの気持ちで試してみたものの、これが識別できるのはうれしい誤算です。書き出したAppleScript Applet名は「Appletでランタイム名を取得」であったため、この「applet」というものとは異なります(ねんのため)。

AutomatorからApplet書き出しして実行


–> “Application Stub”
見たことのない名前が、、、、やっぱり、これも別ランタイムなんですね、、、、

Script DebuggerからApplet(Enhanced)で書き出しして実行


–> “FancyDroplet”
Appleの標準ランタイムとはあきらかに別物(Enhanced)なので、たぶん別の名前がついているだろうとは思っていましたが、そういう名前でしたか。名前が予想外だったので驚かされましたが、識別できることに意義があります。

Cocoa-AppleScript Appletを実行


–> “CocoaApplet”
Script Editor上で作成できる、通常のAppleScriptとXcode上で作成するCocoa-Applicationの中間的な性格を持つ「Cocoa-AppleScript Applet」でランタイムプログラム名を取得したらこうなりました。

もちろん、実行プログラム名はまったく別の「ランタイム名を表示するだけのCocoa-AppleScript Applet」というものです。

ショートカットで「AppleScriptを実行」アクションを実行


–> “MacHelper”

macOS 12で搭載されたショートカット.app(Shortcuts.app)および不可視プロセスのAppleScriptの補助専用アプリケーション「Shortcuts Events.app」上で、アクション「AppleScriptを実行」でAppleScriptを実行するときのランタイム名は、「MacHelper」です。意外なところで、ユーザーディレクトリ以下にインストールされたAppleScriptライブラリをこのMacHelper環境は認識します。

→ macOS 13上では、ショートカット.app(Shortcuts.app)およびShortcuts Events.app上のランタイム名が「ShortcutsMacHelper」に変更されました。

RedSweater Software「FastScripts」からAppleScriptを実行

red sweater softwareによるメニュー常駐型Script Menuソフトウェア「FastScripts」から実行したときのランタイム名は「FascScripts Script Runner」です。

Knurling Group「Service Station」からAppleScriptを実行

Knurling Groupによるコンテクストメニューのカスタマイズ・ソフトウェア「Service Station」から実行したときのランタイム名は「osascript」です。

ランタイム名が得られることで実現できること

これらのほか、各アプリケーション内でAppleScript呼び出し機能を有するもの(ファイルメーカー、Mail.appなど)でランタイムプログラム名を取得すると有益な情報が得られることでしょう。

これは、地球上にいる人類が観測衛星を打ち上げて「ここは銀河系だ」と観測できるぐらいすごいことなので、割と意義深いものです。実行中のAppleScriptが、「いま、何のプログラムによって自分自身が実行されている」かという情報を取得できます。

ランタイムプログラムの名称取得については、いくつかのAppleScript実行方法を試してみましたが、得られる名前に違いがないことを確認しています。

直接AppleScriptを動かす方法に加え、間接的にAppleScriptを動かす方法も試してみましたが、同じ結果が得られました。

つまり、動的にOSAScriptViewを生成して実行しようが、NSAppleScriptで実行しようが、AppleScriptの「run script」コマンドで実行しようが、取得されるランタイム名には差がありません。

これで、ランタイム環境のプロセスの親プロセスの情報が取得できると、Terminal.app上から起動したosascriptコマンドで呼び出したのか、Script Menu上から呼び出したのかという状況をAppleScript側で認識できることになることでしょう。

ランタイム環境を識別した上で、各環境で実行できない処理を行わないとか、ランタイム環境ごとに処理を分岐できるようになることでしょう。

ちょうど、Edama2さんと「ランタイム環境ごとに若干の挙動の違いが見られるし、利用できるCocoaの機能にも違いがあるから、ランタイム環境ごとに認識コードでも振ってみようか」などと相談していたので、渡りに船でした。

Posted in OSA | Tagged 10.13savvy 10.14savvy 10.15savvy Automator CotEditor Script Debugger Script Editor | Leave a comment

最前面のアプリケーションの用語辞書を表示する v4

Posted on 1月 8, 2020 by Takaaki Naganoya

最前面のアプリケーションのAppleScript用語辞書をオープンするAppleScriptです。

macOS標準装備のScript Menuに入れて呼び出すことを前提に作りました。はるかかなた昔に作って、OSバージョンが上がるごとに細かい改修を行なって使い続けているものです。

この手のScriptは日常的にAppleScriptを書いている人間なら、たいてい書いてみたことがあるはずです。しかし、あまり生真面目なアプローチでアプリケーションバンドル中のsdefのパスを求めてオープンといった処理を行っていると、「例外」にブチ当たって困惑します。

sdefファイルを直接持っていないAdobe Creative Cloud製品です。InDesignあたりがそうなんですが、直接sdefを保持しておらず、どうやら実行時に動的に組み立てるようで、絶体パス(absolute path)で指定してもsdefをオープンできません。

また、Microsoft Office系アプリケーションのsdefも、外部の(OS側のsdef)テンプレートをincludeするようなので、生真面目に対象アプリケーションのInfo.plistの情報をもとにアプリケーションバンドル中のsdefファイルをオープンするように処理すると、sdefの一部のみを表示するようになってしまって、sdef全体を表示することができません。

そうしたもろもろの問題に当たって、結局アプリケーションそのものをScript Editorでオープンするように指定しています。

AppleScript名:–このアプリケーションの用語辞書を表示する v4
— Created 2017-07-23 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

–最前面のプロセスのファイルパスを取得する
set aFile to path to frontmost application
set aRec to (getAppPropertyFromInfoPlist(aFile, "NSAppleScriptEnabled") of me) as boolean

–スクリプト用語辞書をScript Editorでオープンする手順
if aRec = true then
  –OS X 10.10でScript Editor側からアプリケーションをオープンしてもダメだったので、Finder側からScript Editorで指定アプリをオープンすることに
  
try
    tell application "Finder"
      set apFile to (application file id "com.apple.scripteditor2") as alias
      
open aFile using application file apFile
    end tell
  on error
    tell application id "com.apple.scripteditor2"
      open aFile
    end tell
  end try
  
  
tell application id "com.apple.scripteditor2" to activate
  
else
  display dialog "本アプリケーションは、各種OSA言語によるコントロールに対応していません。" buttons {"OK"} default button 1 with icon 2 with title "Scripting非対応"
end if

on getAppPropertyFromInfoPlist(aP, aPropertyLabel)
  set aURL to current application’s |NSURL|’s fileURLWithPath:(POSIX path of aP)
  
set aBundle to current application’s NSBundle’s bundleWithURL:aURL
  
set aDict to aBundle’s infoDictionary()
  
  
set aRes to aDict’s valueForKey:aPropertyLabel
  
if aRes is not equal to missing value then
    set aRes to aRes as anything
  end if
  
  
return aRes
end getAppPropertyFromInfoPlist

★Click Here to Open This Script 

Posted in sdef | Tagged 10.12savvy 10.13savvy 10.14savvy 10.15savvy Script Editor | Leave a comment

macOS 10.13以降、スクリプトエディタのヘルプが更新され続けて驚く

Posted on 12月 18, 2019 by Takaaki Naganoya

力が入っているのか抜けているのかわかりませんが、スクリプトエディタのヘルプがOSのメジャーバージョンアップごとに更新されているのを見つけて驚かされました。

 「スクリプトエディタヘルプ」(macOS High Sierra用)
 「スクリプトエディタユーザーガイド macOS Mojave用」
 「スクリプトエディタユーザーガイド macOS Catalina用」

などと、わざわざOSごとに更新され、日本語環境用に翻訳されています。ちょっと驚きました。

ただ、相変わらず内容は「は?」とか「えーー?」とかいう感想しか出てこないものなので、存在している以上の実質的な価値はありません。存在しないよりは数万倍よいのですが、「これを読んで使えるようにはならないだろー」という程度のものです。


▲macOS 10.13用スクリプトエディタユーザガイド。このScreen ShotのScriptは実際に動くので好感が持てるのですが、なぜかこれが次のOSから変更されています。単に「代わり映えしないから変更した」ぐらいの意図であればよいのですが、、、


▲macOS 10.14用スクリプトエディタユーザガイド


▲macOS 10.15用スクリプトエディタユーザガイド

冒頭から内容が、

「OS X 10.10 以降では、AppleScript に加え、スクリプト言語である JavaScript for Automation を使用してスクリプトを記述することができます。また、シェルスクリプトや、UserTalk などの他社製のスクリプト言語を使用してスクリプトを記述することもできます。」

とあり、「あたかもシェルスクリプトをOSA言語的に扱えるかのような間違った印象を与えてしまう」「UserTalk(Frontier)なんてもう誰も使っていないし、消滅して久しいぞ」といったツッコミを行なってしまうところですが、Apple社内の現場が内容のチェックをしないで秘伝のタレのように注ぎ足し注ぎ足しで更新しているだけだと痛感させられます。

内容は機械的に翻訳しているだけのようで、コンテクストメニューから呼び出せるApple純正のScriptはみんなローカライズされていない(事実)のに、ヘルプ内では名称などが日本語訳されて紹介されており、実際にコンテクストメニューを表示させると困惑させられること請け合いです。外注の翻訳会社のせいではなく、Apple側が何も指定しなかったので機械的に翻訳しただけでしょう。


▲macOS 10.15上のスクリプトエディタヘルプでは、コンテクストメニューの項目名が勝手に日本語訳されている。実物は英語なのに、、、、


▲実際にmacOS 10.15上のスクリプトエディタでコンテクストメニューを表示すると英語のまま

macOS標準搭載のコンテクストメニューScriptがあまりにも使えないので、全部捨てて入れ替えて使えるものを突っ込んだものが「Piyomaru Script Assistant」なわけですが、電子書籍のオマケとして付けたこのScriptもmacOS 10.13でいろいろ動かないものが出てきており、ちょうど機会があったので10.14/10.15用にアップデートしました(10.13対応はちょっとダメだと思います。バグの問題というよりも、絵文字の互換性がないので)。

CotEditor用のPowerPackの影響を受けて、そういう方向のScriptも突っ込んでいます。スクリプトエディタのコンテクストメニューから呼び出したAppleScriptから、スクリプトエディタのウィンドウをぐるぐる回してみようとしたら、ほとんど再描画されずに結果だけ表示されるという一幕もありました。

Posted in Bug | Tagged 10.13savvy 10.14savvy 10.15savvy Script Editor | Leave a comment

macOS 10.14でScript Editorのsdefから「execute」コマンドが除去されていた

Posted on 12月 16, 2019 by Takaaki Naganoya

macOS 10.14のスクリプトエディタのAppleScript用語辞書(sdef)から「execute」コマンドが除去されていることに気づきました。

このことは、別に「GUI側からスクリプトエディタ上のAppleScriptを実行できなくなった」ということではありません。

スクリプトエディタ自体もAppleScriptからコントロールできる「スクリプタブルな」アプリケーションであり、macOS 10.14以降ではAppleScriptからスクリプトエディタをコントロールしてAppleScriptを実行させることができなくなった、ということです。

セキュリティ向上のためにexecuteコマンドを削除したように見えますが、そういうことをやったならRelease Notesに明記しておいてほしいものです。

Piyomaru Context menu AssistantのmacOS 10.13版を10.14上で動作確認していたら、動かなくなっているものがあって(クラッシュするものも出てきております)、原因を確認していたら一部の予約語が、

with timeout of 36000 seconds --1時間のタイムアウト
	«event sedsexec»
end timeout

のように文字化け。これによって「execute」(Script実行)の予約語が抹消されたことがわかりました。スクリプトエディタ自体をコントロールしてScriptを実行させるケースは少ないので、世界中でも私ぐらいしか影響はないことでしょう。ちなみに、サードパーティのAppleScript統合開発環境であるScript Debuggerにはexecuteコマンドがあります。

別にスクリプトエディタでAppleScript書類をオープンして実行するような迂遠かつマニアックかつ「もっと簡単な手段があるのにわざわざそんなことしなくても」というアクションを好き好んで行う人はほとんどいないでしょう。全人類のうち、私以外にダメージはないことでしょう。

実際にスクリプトエディタにexecuteコマンドを送って実行していた例というのは、実行時間の計測を行うAppleScriptです。地味にそういうのを使っていました(最近は、Shane StanleyのScript Geekで処理時間を計測するパターンが多いので使っていませんでしたが)。


▲macOS 10.13.6


▲macOS 10.13.6


▲macOS 10.14.6


▲macOS 10.14.6


▲macOS 10.15.2


▲macOS 10.15.2

Posted in sdef | Tagged 10.14savvy 10.15savvy Script Editor | Leave a comment

sdefの内容を強引に取得する

Posted on 9月 12, 2019 by Takaaki Naganoya

指定アプリケーションのsdefの内容を強引に取得するAppleScriptです。

スクリプトエディタをAppleScriptからコントロールして、指定アプリケーションのsdef(AppleScript用語辞書)の内容を取得します。もちろん、AppleScript対応のアプリケーションに限ります。対応/非対応の判定はあらかじめ行なっておいてください。

そもそも、なんでこれが必要になったかといえば、各種AppleScript Libraryの整備のための資料として、既存のAppleScript対応アプリケーションの識別コード(4文字コード)を取得して確認しておきたかったためです。

そこで、まっとうな方法だと、

step 1:対象アプリケーションのInfo.plistの内容を確認してsdefの名称を取得

step 2:アプリケーションバンドル内のsdefを取得

という流れになります。これで済めば処理は非常に短時間に完了します。ファイル処理だけなので。

しかし、実際にやってみると…………標準的な方法でsdefを取得できないアプリケーションがいくつか存在することに気づきます。

(1)Adobe Illustratorなど

バンドル内にsdefが存在しない。動的にプログラムでsdefを生成しているのでは?

(2)scriptSuite+scriptTerminologyに分かれている場合

バンドル内にsdefではなく.scriptSuiteファイルと.scriptTerminologyファイルを格納。テキストエディット(TextEdit.app)やスクリプトエディタ(Script Editor.app)などが該当する。

また、一部のアプリケーション(MS-Officeなど)ではsdefファイルのうち一部を外部からincludeしているため、アプリケーションバンドル内のsdefファイルを読んだだけでは完全なsdefが取得できないといった問題もあります。

そこで、この「スクリプトエディタをコントロールしてsdefの内容を取得する」という頭の悪そうな処理が必要になりました。シェルのsdefコマンドを使えばいいんじゃない? という意見も出てきそうですが、現行環境(macOS 10.14.x)でsdefコマンドはうまく動いていないように見えます。

AppleScript名:sdefの内容を強引に取得する.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/09/12
—
–  Copyright © 2019 jp.piyomarusoft, All Rights Reserved
—

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

set aPath to (choose file of type "com.apple.application-bundle" default location (path to applications folder) with prompt "Select an application")
set sdefContents to getForceSdefContentsUsingSE2(aPath) of me

on getForceSdefContentsUsingSE2(anAlias)
  try
    tell application id "com.apple.ScriptEditor2"
      open anAlias
      
tell front document
        set dictPath to path
      end tell
    end tell
  on error erM
    return erM
  end try
  
  
  
tell current application
    set aSdef to read dictPath
  end tell
  
  
tell application id "com.apple.ScriptEditor2"
    tell front document
      close without saving
    end tell
  end tell
  
  
return aSdef
end getForceSdefContentsUsingSE2

★Click Here to Open This Script 

Posted in file sdef | Tagged 10.12savvy 10.13savvy 10.14savvy Script Editor | Leave a comment

Script Editor, Script Debuggerから選択範囲の情報を取得

Posted on 8月 19, 2019 by Takaaki Naganoya

スクリプトエディタ(Script Editor)およびScript Debuggerの最前面の書類から選択範囲の情報を取得するAppleScriptです。

スクリプトエディタとScript Debuggerで動く共通のツールをAppleScriptで作ってみたら、結果が異なりました。両エディタで同じ範囲を選択してみても、


▲Script Editor上で選択(左)、Script Debugger上で選択(右)

Script Editorでは、character range of selectionを実行すると、{文字開始位置, 文字終了位置}を返してきます。

一方、Script Debuggerでは、character range of selectionを実行すると、{文字開始位置, 選択文字長}を返してきます。

この違いにより、両エディタで異なる結果が得られたのでした。

選択中のテキスト(contents of selection)をそのまま取得して処理するのはよくあるパターンです。選択範囲を数値で取得するケースは(個人的に)あまりありませんでした。

これらのエディタ上で選択中のAppleScriptソースを取得して、そのままコンパイル(構文確認)して変数のみ抽出して変数名の一覧リストが欲しかったのですが、部分的にコンパイル(構文確認)しただけではエラーになる例が多い(ライブラリを呼び出している場合とか)ので、ファイル全体をコンパイル(構文確認)したのちに、エディタ上の選択範囲に該当するデータを抽出するように変更してみました。


▲選択範囲からAppleScript構文色分け情報をもとに変数のみ列挙して返すAppleScriptを実行。このために両エディタ対応を調べていた

AppleScript名:Ecript Editorの選択範囲情報を取得.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/08/19
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
tell application "Script Editor"
  tell front document
    set {cStart, cEnd} to character range of selection –{start pos, end pos}
    
return {cStart, cEnd}
    
–> {516, 1334}
  end tell
end tell

★Click Here to Open This Script 

AppleScript名:Script Debuggerの選択範囲情報を取得
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/08/19
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
tell application "Script Debugger"
  tell front document
    set {cStart, cNums} to character range of selection –{start pos, length}
    
return {cStart, cStart + cNums – 1}
    
–> {516, 1335}
  end tell
end tell

★Click Here to Open This Script 

Posted in list Text | Tagged 10.12savvy 10.13savvy 10.14savvy Script Debugger Script Editor | Leave a comment

選択中のリストのテキスト(多分)をもとにKeynoteの表を作成 v2

Posted on 8月 1, 2019 by Takaaki Naganoya

Script Editor上で選択中の1D List(1次元配列)のテキストを評価してリストとして解釈し、それをもとにKeynoteの新規書類上に表を作成するAppleScriptの改良版です。

こんな感じ(↑)に、Script Editor上で1D List(1次元配列)のテキストが存在しているものを、資料化するためにKeynote上で表にすることがあり、その作業を自動化してみました。

スクリプトエディタ上の選択範囲のテキストをrun scriptコマンドで実際に実行(Evalのような使い方)して本物のAppleScriptのリストを作成して処理します。

ここがたいへんにセキュリティホールになりやすいので、実行前にテキストをAppleScriptとして構文確認を行い、危ない構文要素(コマンド類)が入っていないか、AppleScriptの構文的に中途半端でないかチェックを行います。

技術的にはMac OS X 10.4ないし10.5の時代に確立していた内容ではありますが、当時はスクリプトエディタをコントロールして構文色分け情報を取得していたので、macOS 10.10以降でCocoaの機能がAppleScriptから直接利用できるようになって、よりスマートに処理できるようになりました。

Mac OS X 10.4の時代には、plistの情報はテキストで記録されていたので、構文色分け設定を読むのは簡単でした。スクリプトエディタから書式つきテキスト情報(attribute runs)を取得して付け合わせを行っていました。途中でplistの内容がバイナリ化されてplistを読むことが難しくなったので、新規書類に「すべての構文要素が入った最低限度のAppleScript」を転送して構文確認を行い、attribute runsを取得して規定の場所の書式情報を取得することで、特定の構文要素の色分け情報を取得していました(一瞬で新規書類を作成して構文確認し、すぐに破棄するので目には見えない)。

–> Download selectedStrToKeynoteTable (Source AppleScript Bundle with Library)

–> Download selectedStrToKeynoteTableWithCodeSign(AppleScript Applet executable with Code Sign)

ただし、本ScriptをmacOS 10.14上で実行してみていろいろ問題を感じました。まずは、スクリプトエディタ/Script Debugger上で実行する分には何も問題はありません。ここは大事なので明記しておきます。

これ以外の実行環境で実行させると、とたんに首をひねりたくなるような挙動が見られます。Script Menuから実行することを前提に作ってみたわけですが………

普通にScriptとして保存して実行(署名なし、公証なし):初回実行時にオートメーション認証ダイアログが表示されて実行。数回同じScriptを実行すると実行されなくなる(!)

Appletとして保存して実行(署名なし、公証なし):実行時、毎回オートメーション認証ダイアログが表示されて実行。

Appletとして保存して実行(署名あり、公証なし):初回実行時、オートメーション認証ダイアログが表示されて実行。連続して実行するとダイアログ表示なし。しばらく時間を置いて実行するとダイアログ表示される。

macOS 10.14については2か月前から使い始めたので、公証についてもまだうまく行えていません(SD Nortaryで開発者IDが認識されない、、、)。こちら(公証)も試してみるべきなんでしょう。

公証関連については、実際に行っている方、失敗した方の意見をまとめておきたいので、本Blog併設のフォーラムにて(言語は英語でも何語でもOKなので)情報交換させてください。

AppleScript名:選択中のリストのテキスト(多分)をもとにKeynoteの表を作成 v2
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/07/31
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
use dangerAS : script "checkDangerAS"

set aTargMasterSlide to "空白" –This string is *Localized* in Japanese. This is "Blank"

tell application "Script Editor"
  tell front document
    set bText to contents of selection
  end tell
end tell

if bText = "" then return

–指定のテキストをAppleScriptとして評価し、指定の構文要素に該当するものが含まれているかどうかチェック
set dRes to chkTargLexicalElementsFromCompiledScriptAttribute(bText, {9, 14}) of dangerAS
if dRes = missing value then
  –The selected text contains AppleScript lexical error
  
display dialog "選択中のテキストにAppleScriptの構文エラーが検出されました" default answer bText with title "Error" with icon 2
  
return
end if

if dRes = true then
  –The selected text contain danger AppleScript lexical element (maybe it is any command)
  
display dialog "選択中のテキストは実行に危険な文字列(AppleScriptコマンド)を含んでいるため、処理しませんでした" default answer bText with title "Error" with icon 2
  
return
end if

try
  set aRes to run script bText –Danger!! Take Care of.
  
set aClass to class of aRes
on error
  –The Evaluation error (some AppleScript lexical error)
  
display dialog "The contents of clipboard seems not to be an AppleScript list but " & (aClass as string) & return & bText with title "Error (1)" with icon 2
  
return
end try

if aClass is not equal to list then
  –The Evaluated result is not list
  
display dialog "The contents of clipboard seems not to be an AppleScript list but " & (aClass as string) & return & bText with title "Error (2)" with icon 2
  
return
end if

set aLen to length of aRes
set aDim to getDimension given tArray:aRes
if aDim > 1 then
  –Check List’s dimension (the taeget dimension is 1)
  
display dialog "選択中のテキストを評価したリスト(配列)の次元数が1ではなかったので、処理しませんでした" default answer bText with title "Dimension Error(3)" with icon 2
  
return
end if

tell application "Keynote"
  activate
  
set aDoc to (make new document with properties {document theme:theme "ホワイト", width:1024, height:768}) — –This string is *Localized* in Japanese. This is "White"
  
  
tell aDoc
    set masList to name of every master slide
    
if aTargMasterSlide is not in masList then return –多分ないと思うが、作成予定のマスタースライドが現在有効でない場合に処理打ち切り
    
    
set base slide of current slide to master slide aTargMasterSlide
    
    
tell current slide
      set aTable to make new table with properties {header column count:0, header row count:1, row count:2, column count:aLen, name:"Test Table"}
      
      
tell aTable
        repeat with y from 1 to 1
          tell row y
            repeat with x from 1 to aLen
              tell cell x
                set value to (item x of aRes) as string
              end tell
            end repeat
          end tell
        end repeat
      end tell
      
    end tell
  end tell
end tell

–指定Listの次元を再帰で取得する
on getDimension given tArray:aList as list : {}, curDim:aNum as integer : 1
  set anItem to contents of first item of aList
  
set aClass to class of anItem
  
  
if aClass = list then
    set aNum to aNum + 1
    
set aRes to getDimension given tArray:anItem, curDim:aNum
  else
    return aNum
  end if
end getDimension

★Click Here to Open This Script 

Posted in Code Sign Color list Notarization OSA regexp | Tagged 10.12savvy 10.13savvy 10.14savvy Keynote Script Editor | Leave a comment

選択中のリストのテキスト(多分)をもとにKeynoteの表を作成

Posted on 7月 31, 2019 by Takaaki Naganoya

Script Editor上で選択中の1D List(1次元配列)のテキストを評価してリストとして解釈し、それをもとにKeynoteの新規書類上に表を作成するAppleScriptです。

こんな感じ(↑)に、Script Editor上で1D List(1次元配列)のテキストが存在しているものを、資料化するためにKeynote上で表にすることがありますが、これが個人的に超絶かったるいです。

きれいにデータになっているものを、表のセルに細切れにして突っ込む作業がかったるいので、おそらくそれを手動で行う数倍の時間をかけてAppleScriptで自動化しておきました。

(1)Script Editor上でListの箇所を選択しておく
(2)Script Menuに入れておいた本Scriptを呼び出す
(3)Keynoteで新規書類を作成し、1ページ目に表を新規作成し、(1)の内容を1行目に代入

という動作を行います。上記のとおり、Script Menuに入れて呼び出すことを前提にしています。もし、そうでなければ当該部分をコピーしておいて、クリップボード経由で受け取るようにしてみてください。

当初は本Scriptもそういう構造になっていましたが、選択部分をコピーするのを忘れることが多いため、選択箇所から取得するように変更しました。

本Scriptは自分自身で使うことを前提に作ったため(本Blogまるごとそんなもんですが)、run scriptコマンドで文字列をAppleScriptとして評価して実行して結果を取得するという、ひじょーーーーーにセキュリティホールになりやすい処理を行っています。

本来、取得した文字列をAppleScriptとして評価して、構文要素的に「コマンド類」が入っていないか(とくにdo shell script)を評価する必要があると思います。その上で、もしもコマンド類が入っていた場合にはユーザーに再考を促すようにダイアログを表示するなどの処理を行うのがまっとうなやりかたでしょう。

このあたり、ものすごくラフに作ったので、利用はあくまで自己責任で行ってください(本Blogまるごとそんなもんですが)。

AppleScript名:選択中のリストのテキスト(多分)をもとにKeynoteの表を作成
—
–  Created by: Takaaki Naganoya
–  Created on: 2019/07/31
—
–  Copyright © 2019 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set aTargMasterSlide to "空白" –This string is *Localized* in Japanese. This is "Blank"

tell application "Script Editor"
  tell front document
    set bText to contents of selection
  end tell
end tell

if bText = "" then return

try
  set aRes to run script bText –Danger!! Take Care of.
  
set aClass to class of aRes
on error
  display dialog "The contents of clipboard seems not to be an AppleScript list (1)." with title "Error"
  
return
end try

if aClass is not equal to list then
  display dialog "The contents of clipboard seems not to be an AppleScript list (2)." with title "Error"
  
return
end if

set aLen to length of aRes

tell application "Keynote"
  activate
  
set aDoc to (make new document with properties {document theme:theme "ホワイト", width:1024, height:768}) — –This string is *Localized* in Japanese. This is "White"
  
  
tell aDoc
    set masList to name of every master slide
    
if aTargMasterSlide is not in masList then return –多分ないと思うが、作成予定のマスタースライドが現在有効でない場合に処理打ち切り
    
    
set base slide of current slide to master slide aTargMasterSlide
    
    
tell current slide
      set aTable to make new table with properties {header column count:0, header row count:1, row count:2, column count:aLen, name:"Test Table"}
      
      
tell aTable
        repeat with y from 1 to 1
          tell row y
            repeat with x from 1 to aLen
              tell cell x
                set value to (item x of aRes) as string
              end tell
            end repeat
          end tell
        end repeat
      end tell
      
    end tell
  end tell
end tell

★Click Here to Open This Script 

Posted in list | Tagged 10.12savvy 10.13savvy 10.14savvy Keynote Script Editor | Leave a comment

Post navigation

  • Older posts

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

Google Search

Popular posts

  • 開発機としてM2 Mac miniが来たのでガチレビュー
  • macOS 13.6.5 AS系のバグ、一切直らず
  • CotEditorで2つの書類の行単位での差分検出
  • Apple純正マウス、キーボードのバッテリー残量取得
  • macOS 15, Sequoia
  • 初心者がつまづきやすい「log」コマンド
  • ディスプレイをスリープ状態にして処理続行
  • 指定のWordファイルをPDFに書き出す
  • Adobe AcrobatをAppleScriptから操作してPDF圧縮
  • メキシカンハットの描画
  • 与えられた文字列の1D Listのすべての順列組み合わせパターン文字列を返す v3(ベンチマーク用)
  • Pages本執筆中に、2つの書類モード切り替えに気がついた
  • 2023年に書いた価値あるAppleScript
  • Pixelmator Pro v3.6.4でAppleScriptからの操作時の挙動に違和感が
  • AdobeがInDesign v19.4からPOSIX pathを採用
  • Safariで「プロファイル」機能を使うとAppleScriptの処理に影響
  • Cocoa Scripting Course 続刊計画
  • NaturalLanguage.frameworkでNLEmbeddingの処理が可能な言語をチェック
  • macOS 14.xでScript Menuの実行速度が大幅に下がるバグ
  • Numbersで選択範囲のセルの前後の空白を削除

Tags

10.11savvy (1102) 10.12savvy (1243) 10.13savvy (1392) 10.14savvy (587) 10.15savvy (438) 11.0savvy (283) 12.0savvy (207) 13.0savvy (168) 14.0savvy (118) 15.0savvy (95) CotEditor (64) Finder (51) iTunes (19) Keynote (115) NSAlert (61) NSArray (51) NSBitmapImageRep (20) NSBundle (20) NSButton (34) NSColor (51) NSDictionary (27) NSFileManager (23) NSFont (19) NSImage (41) NSJSONSerialization (21) NSMutableArray (62) NSMutableDictionary (21) NSPredicate (36) NSRunningApplication (56) NSScreen (30) NSScrollView (22) NSString (117) NSURL (97) NSURLRequest (23) NSUTF8StringEncoding (30) NSView (33) NSWorkspace (20) Numbers (72) Pages (53) 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
  • 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
  • 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年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