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

月: 2020年7月

libPhoneNumbermacOSで電話番号のバリデーション v2

Posted on 7月 30, 2020 by Takaaki Naganoya

Googleがgithubで公開しているlibPhoneNumberをmacOSなどに向けてポーティングした「libPhoneNumbermacOS」を呼び出して電話番号の妥当性チェックを行うAppleScriptです。

github上のプロジェクトをダウンロードしてXcodeでビルドすれば、普通にCocoa Frameworkを作れるので各自ご自分でビルドしてください。実行は、macOS 10.14以降であればScript Debuggerが必要です(Xcode上で作成するAppleScriptアプリケーションであれば、とくにScript Debuggerは必要ありません。XcodeのAppleScript編集機能が低すぎて結局Script Debuggerは必要になるのですが)。

これから先、macOSやAppleScriptも電話機能や電話番号との付き合いが増えてくるはずなので、電話番号の妥当性チェックは必要になることでしょう。

libPhoneNumberには電話番号の妥当性チェックの機能のほか、電話番号から位置情報を求められるようですが、Blocks構文の記述が必要なのでソース自体に手を加える必要がありそうなので手を出していません。

AppleScript名:libPhoneNumbermacOSで電話番号のバリデーション v2.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/29
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use framework "libPhoneNumbermacOS" –https://github.com/iziz/libPhoneNumber-iOS
use scripting additions

property NBEPhoneNumberFormatE164 : 0
property NBEPhoneNumberFormatINTERNATIONAL : 1
property NBEPhoneNumberFormatNATIONAL : 2
property NBEPhoneNumberFormatRFC3966 : 3

set pUtil to current application’s NBPhoneNumberUtil’s alloc()’s init()

set {myPhone, pRes} to pUtil’s parse:"03-5297-2311" defaultRegion:"JP" |error|:(reference) –JPNICの電話番号
if pRes is not equal to missing value then return

set vRes to (pUtil’s isValidNumber:myPhone) as boolean

–E164形式(ITU-T(国際電気通信連合 電気通信標準化セクター) E.164勧告)
set vResE164 to pUtil’s format:myPhone numberFormat:(NBEPhoneNumberFormatE164) |error|:(reference)
log {"E164", vResE164}
–> {"E164", {(NSString) "+81352972311", missing value}}

–国際電話形式
set vResINTN to pUtil’s format:myPhone numberFormat:(NBEPhoneNumberFormatINTERNATIONAL) |error|:(reference)
log {"INTERNATIONAL", vResINTN}
–> {"INTERNATIONAL", {(NSString) "+81 3-5297-2311", missing value}}

–国内形式
set vResNATN to pUtil’s format:myPhone numberFormat:(NBEPhoneNumberFormatNATIONAL) |error|:(reference)
log {"NATIONAL", vResNATN}
–> {"NATIONAL", {(NSString) "03-5297-2311", missing value}}

–RFC3966形式
set vResRFC3966 to pUtil’s format:myPhone numberFormat:(NBEPhoneNumberFormatRFC3966) |error|:(reference)
log {"RFC3966", vResRFC3966}
–> {"RFC3966", {(NSString) "tel:+81-3-5297-2311", missing value}}

set cRes to (pUtil’s extractCountryCode:"+81-3-5297-2311" nationalNumber:(missing value)) as integer
–> 81

set nationalNumber to missing value
set {cRes, nRes} to (pUtil’s extractCountryCode:"+81-3-5297-2311" nationalNumber:(reference))

return {cRes as integer, nRes as string}
–> {81, "-3-5297-2311"}

★Click Here to Open This Script 

(Visited 75 times, 1 visits today)
Posted in Telephony Text | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

アラートダイアログでMarkdownをプレビュー

Posted on 7月 29, 2020 by Takaaki Naganoya

edama2さんからの投稿です。実際に動かして「こんな素朴な記述でMarkdownのプレビューができるのか?!」とぶっ飛びましたが、箱庭グラフ表示シリーズ(JavaScriptのライブラリに描画丸投げ)と同様、外部のJavaScriptライブラリを呼んで表示しています。

→ Download archive

タイトルは「アラートダイアログでMarkdownをプレビュー」
アラートダイアログ上でMarkdownのプレビュー表示をします
中身はhtml内のjavascriptで変換してWkWebViewで表示しているだけなので今更目新しいこともありません
一応うまく動いていると思いますが、いろんなパターンを試したわけじゃないのでちょっと不安です

技術的に見所が多すぎて困るぐらいの内容です。ちょろっと流せるぐらいの規模ではありません。

JavaScriptのライブラリでMarkdownのプレビューが行えるというのは、割と盲点でした。グラフやらアニメーションやらはさんざんJavaScriptを呼び出して表示させていましたが、Markdownのプレビューまで行えるとは。

主に、Markdownのレンダリング系のフレームワークとか、AppleがXcodeに添付したMarkdownのプレビュー機能あたりが活用できないか調べていたことはありましたが、CDN上のJavaScriptを呼び出してプレビューというのはなかなか強力です。

さらに、本Scriptはblocks構文が必要なAPIに対してパラメータにmissing valueを指定することで呼び出せています。

blocks構文のパラメータにヌル文字やmissing valueを指定することで誤魔化せるケースがあることはedama2さんと話して知っていましたが、実例として提示されたのはこれがはじめてでしょう(macscripter.netでも見かけない)。

また、箱庭WebViewダイアログ系のプログラムが「スクリプトエディタ上から実行すると、実行後にウィンドウのオブジェクトがメモリ上に残ったままになる」という問題を抱えていた点を解決……はできていないですね。Appletで動かせば解決できるのと、親プロセス(スクリプトエディタやScript Debugger)が終了するとまとめて消えるので、その方向でなんとか対処を。


▲添付のサンプルMarkdown書類をプレビューしたところ。表のレンダリングができている点に驚き


▲実際に書籍用にメンテナンスしているMarkdown書類をプレビュー。applescript://のURLリンクも有効。インラインHTMLの類いも使える


▲箱庭Webダイアログの負の遺産、実行するたびにたまるゴミプロセス。これで解消なるか?!→それは無理でした

ちなみに、CotEditorのスクリプトメニューに組み込んで実行してみましたが、ネットワークへのアクセスが必要なためCotEditor側のセキュリティポリシーと合わずに実行できませんでした。 → できました。WebKitをuseし忘れていただけのようです(CDN上のライブラリで円グラフ表示できているので、逆にできないのがおかしいと気づきました)。

macOS標準装備のスクリプトメニュー内から、Applet形式に書き出したAppleScriptを呼び出すスタイルにしたら実行できました。

AppleScript名:アラートダイアログでMarkdownをプレビュー
use AppleScript
use framework “Foundation”
use scripting additions

on run
  my main()
end run


on main()
  set mes to “Markdownファイルを選択してください。”
set chooseItems to choose file of type {“net.daringfireball.markdown”} with prompt mes


  #
set aScreen to current application’s NSScreen’s mainScreen()
set screenFrame to aScreen’s frame()
set aHeight to current application’s NSHeight(screenFrame)
set aWidth to current application’s NSWidth(screenFrame)
set aHeight to aHeight * 0.845
set aWidth to aWidth * 0.94 / 2


  set paramObj to {}
set paramObj to paramObj & {myMessage:“Markdown preview”}
set paramObj to paramObj & {mySubMessage:“file : “ & chooseItems’s POSIX path}
set paramObj to paramObj & {mdFile:chooseItems}
set paramObj to paramObj & {viewWidth:aWidth}
set paramObj to paramObj & {viewHeight:aHeight}


  my performSelectorOnMainThread:“displayMarkdownPreview:” withObject:(paramObj) waitUntilDone:true
end main


# Markdownをダイアログで表示
on displayMarkdownPreview:paramObj
  set mesText to myMessage of paramObj as text
set infoText to mySubMessage of paramObj as text
set mdFile to (mdFile of paramObj) as alias
set viewWidth to (viewWidth of paramObj) as integer
set viewHeight to (viewHeight of paramObj) as integer


  ## HTMLを読み込む
set mePath to path to me
set resPath to (mePath & “Contents:Resources:index.html”) as text
set htmlStr to (read (resPath as alias) as «class utf8») as text


  ## MDを読み込む
set mdStr to (read mdFile as «class utf8») as text


  ## MD内に改行があるとうまく読み込まれないので改行を置き換え
set mdStr to current application’s NSString’s stringWithString:mdStr
set mdStr to mdStr’s stringByReplacingOccurrencesOfString:(linefeed) withString:“\\n”
set mdStr to mdStr’s stringByReplacingOccurrencesOfString:“’” withString:“\\’”


  ## html内の文字を置き換え
set aString to current application’s NSString’s stringWithFormat_(htmlStr, mdStr) as text
log result


  ## baseURL
set aPath to mdFile’s POSIX path
set baseURL to current application’s NSURL’s fileURLWithPath:aPath
set baseURL to baseURL’s URLByDeletingLastPathComponent()


  ##
set aConf to current application’s WKWebViewConfiguration’s new()
tell current application’s WKUserContentController’s new()
    aConf’s setUserContentController:it
  end tell


  ## WebViewを作成&読み込み
set frameSize to current application’s NSMakeRect(0, 0, viewWidth, viewHeight)
tell current application’s WKWebView’s alloc()
    tell initWithFrame_configuration_(frameSize, aConf)
      setNavigationDelegate_(me)
setUIDelegate_(me)
loadHTMLString_baseURL_(aString, baseURL)
set theView to it
    end tell
  end tell


  ## アイコンの指定
set aImage to current application’s NSWorkspace’s sharedWorkspace()’s iconForFileType:“net.daringfireball.markdown”


  ## set up alert
tell current application’s NSAlert’s new()
    addButtonWithTitle_(“Close”)
setAccessoryView_(theView)
setIcon_(aImage)
setInformativeText_(infoText)
setMessageText_(mesText)
tell |window|()
      setInitialFirstResponder_(theView)
    end tell
### show alert in modal loop
if runModal() is (current application’s NSAlertSecondButtonReturn) then return
  end tell


  ##後始末
theView’s stopLoading()
set js to “window.open(’about:blank’,’_self’).close();”
theView’s evaluateJavaScript:js completionHandler:(missing value)
set theView to missing value
end displayMarkdownPreview:

★Click Here to Open This Script 
(Visited 66 times, 1 visits today)
Posted in dialog JavaScript Markdown | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

画像の空白判定プログラムの検証

Posted on 7月 28, 2020 by Takaaki Naganoya

画像の全ピクセルが白かどうかチェックする処理ルーチンは、必要に迫られて作ったものです。しかも、高速処理が求められます。

アイコン画像よりも小さな、たかだか1024 x 768ピクセルの画像であっても、全画素の空白をループでチェックしたら78万ピクセルあるわけで、地道に画像に対して座標を指定しつつ78万回カラーチェックを行うのは現実的ではありません。

作成した空白チェックのルーチンは3つ。

(1)Photoshopの明度ヒストグラム機能を利用するもの

Adobe Photoshopの明度ヒストグラム機能を利用するもの。はるかかなた昔から使っており、信頼性も高かったものの実行にはPhotoshopを要するため、どこでも同様に実行するわけにはいきませんでした。HTMLをPDF出力させたときに、無駄な空白ページが末尾にできることをチェックしたりと、重要な処理に使ってきました(プリントアウト時に無駄紙を省けるとか。枚数が増えると割と切実な問題です)。

(2)GPUImage.frameworkを利用するもの

オープンソースのGPUImage.framework(Objective-Cで書かれた初代のGPUImage 1)を呼び出して明度ヒストグラム計算を実行。スピード、コストなどの面で問題を解決できていますが、GPUImage自体がSwiftで書き直されたり、OpenGLからMetal向けに書き直されたりで、GPUImage 1自体の継続性については問題がある状態です。

(3)AppleScriptだけで書き直したもの

Cocoaの機能を利用して画像の空白チェックを実現。元画像のコピーを作って、白くぬりつぶして、オリジナル画像との照合を行う。同じであれば空白画像、同じでなければ空白画像ではないという判定を行います。4K解像度以下であれば最速。

そして、今後(1)〜(3)のどれを使い続けるべきかを、macOS 10.14.6でチェックしてみました。テストプログラムでは空白画像検出時にtrueを、空白でない場合にはfalseを返す仕様に。

(1) (2) (3)
1024x768_1_black.png false true false
4K_3840x2160_1_pixel_black.psd false true false
1x1_white.png true false true

結果は、(1)と(3)が同じ結果を返しました。(2)だけ結果が異なるケースが見られたため、Photoshopの有無に左右されないことを考えると(3)が有力といえます。

実際に、Mac App Store上で販売しているPDF差分検出ツール「Double PDF」ではv2.0からはGPUImageの利用をやめ、処理内容をすべてAppleScriptだけで行うことでスピードアップを果たしています。

この空白画像の検出以外でどの程度GPUImage 1がmacOS 10.14以降の環境で使えるか、使えないかは別のテストが必要でしょう。

(Visited 71 times, 1 visits today)
Posted in Image | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Photoshop | Leave a comment

カラーリストの処理

Posted on 7月 27, 2020 by Takaaki Naganoya

カラーリストまわりの情報を取得するAppleScriptです。

カラーピッカーで取得できる各種色セットの内容を取得できたりと、割と使いでがあります。

AppleScript名:使用可能なカラーリスト名称一覧を取得.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/26
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set cList to ((current application’s NSColorList’s availableColorLists())’s valueForKeyPath:"name") as list
–> {"Apple", "System", "World", "Europe", "Japanese", "Scrivener", "AquaPro", "Crayons", "Web セーフカラー"}

★Click Here to Open This Script 

AppleScript名:指定名称のカラーリストに登録されているNSColorを配列で取得.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/26
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set aColList to (current application’s NSColorList’s colorListNamed:"Crayons")

set kList to (aColList’s allKeys()) as list
set colList to {}
repeat with i in kList
  set j to contents of i
  
set cVal to (aColList’s colorWithKey:j)
  
set the end of colList to cVal
end repeat

return colList

★Click Here to Open This Script 

(Visited 60 times, 1 visits today)
Posted in Color System | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSColor NSColorList | Leave a comment

CPUタイプを取得

Posted on 7月 23, 2020 by Takaaki Naganoya

実行中のMacのCPUタイプを取得するAppleScriptです。ARM Macではまた別の結果が返ってくることでしょう。

追記:
匿名希望のDTKユーザー1号さんから教えてもらいました。

set cpuStr to CPU type of (system info)

のDTKマシン上での実行結果は、Rosetta2環境では「Intel」、ARMネイティブ環境では「ARM」と返ってくるのだとか。1号さんに念を押されたのですが、まだβ段階なので将来的に同じ値が返ってくるかは保証できないということです。

正直、予想していたのは「ARM」か「Apple」かの2択だったので納得な内容です(詳細なモデル識別子をスペースを付けて出力してこないことも予想ずみ)。

おそらくですが、Mac用のApple Silicon(ARM)は複数タイプのもの(ノート用、外部GPUを用いるハイエンドデスクトップ用)が出てくるでしょうし、世代ごとにモデル名が変わっていくことでしょう(A14XBionicとか)。それでも、CPUタイプが識別できることの意義は、

「ARM Mac上なのにRosetta2環境で動作しているからパフォーマンスが落ちるかもしれないよ?」

といった警告メッセージを表示するぐらいでしょうか。AppleScriptのsystem infoコマンドで得られるCPU typeについては、Intel Macになってもながらく「Intel 80486」といったいい加減な名前を返してくるぐらいだったので、アーキテクチャ判定以上の情報を得られるという期待は持たないほうがよいでしょう。逆を言えば、Intel 80486の時代にすでにその定数が内部で定義されていた(Intel CPU上でMacOSを動作させるプロジェクトがあった)という証拠ともいえます(Star Trek projectの時代?)。

--macOS 10.14.6+Intel Mac (system info)
{AppleScript version:"2.7", AppleScript Studio version:"1.5.3", system version:"10.14.6", short user name:"me", long user name:"Takaaki Naganoya", user ID:504, user locale:"en_JP", home directory:alias "Machintosh HD:Users:me:", boot volume:"Machintosh HD", computer name:"MBPretina", host name:"MBPretina.local", IPv4 address:"xx.xx.xx.xx", primary Ethernet address:"xx:xx:xx:xx:xx:xx", CPU type:"Intel 80486", CPU speed:2600, physical memory:8192}

--macOS 10.15.6+Intel Mac (system info)
{AppleScript version:"2.7", AppleScript Studio version:"1.5.3", system version:"10.15.6", short user name:"me", long user name:"Takaaki Naganoya", user ID:502, user locale:"ja_JP", home directory:alias "Macintosh HD:Users:me:", boot volume:"Macintosh HD:", computer name:"YasMBP", host name:"YasMBP.local", IPv4 address:"xx.xx.xx.xx", primary Ethernet address:"xx:xx:xx:xx:xx:xx", CPU type:"Intel 80486", CPU speed:2700, physical memory:8192}

--macOS 11.0+Intel Mac (system info)
{AppleScript version:"2.7", AppleScript Studio version:"1.5.3", system version:"11.0", short user name:"me", long user name:"Takaaki Naganoya", user ID:501, user locale:"ja_JP", home directory:alias "Macintosh HD:Users:me:", boot volume:"Macintosh HD:", computer name:"Mac mini 2014", host name:"MacMini2014.local", IPv4 address:"xx.xx.xx.xx", primary Ethernet address:"xx:xx:xx:xx:xx:xx", CPU type:"Intel x86-64h Haswell", CPU speed:2600, physical memory:16384}
AppleScript名:CPUタイプを取得.scpt
set aRes to getCPUType() of me
–> "PowerPC"
–> "Intel"

on getCPUType()
  set cpuStr to CPU type of (system info)
  
set aInd to (offset of " " in cpuStr)
  
if aInd = 0 then return cpuStr
  
set cpuStr to text 1 thru (aInd – 1) of cpuStr
  
return cpuStr
end getCPUType

★Click Here to Open This Script 

(Visited 70 times, 1 visits today)
Posted in System | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

HandBrakeがAppleScriptに対応したのはいいんだけど……

Posted on 7月 23, 2020 by Takaaki Naganoya

リッピングやメディアトランスコーディングを行うソフトウェア「HandBrake」がAppleScriptに対応するという話を少し前に聞いていました。今日確認したらアップデートしてAppleScript用語辞書がついていることを確認。

ただし……

AppleScript用語辞書がまるっきりダメです。使いものにならない用語ばかりで、何かよそのアプリケーションの用語辞書をコピーしただけのようです。

この辞書では、アプリケーションを起動してバージョンなどの情報を確認するのと、指定のファイルをオープンするぐらいしかできません。キューに指定ムービーを追加するとか、エンコーディング形式を指定するとか、最重要コマンドである「start」といった用語も何もありません。

正直、この出来だと「HandBrake CLI」経由でHandBrakeのコア機能を呼び出した方が使いでがあると思います。

AppleScript名:HandBrakeの情報を取得.scpt
tell application "HandBrake"
  properties
  
–> {frontmost:false, class:application, name:"HandBrake", version:"1.3.3"}
end tell

★Click Here to Open This Script 

AppleScript名:handBrakeで指定ファイルをオープン.scpt
set aFile to choose file

tell application "HandBrake"
  open aFile
end tell

★Click Here to Open This Script 

(Visited 44 times, 1 visits today)
Posted in sdef | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy HandBrake | Leave a comment

インライン画像つきスタイル付きテキストの作成 v1b

Posted on 7月 22, 2020 by Takaaki Naganoya

スタイル付きテキストの中に画像を入れるAppleScriptです。

–> Download Script bundle with Library


▲上左:macOS 10.13、上右:macOS 10.14、下左:macOS 10.15

画像をNSTextAttachmentに入れてNSAttributedStringに追加するのが本来の処理方法ですが、macOS 10.13と10.14ではNSTextAttachment中の画像が上下逆になるというバグを見つけてしまいました(10.15以降では修正されています)。

ただし、これは全言語共通のバグなので回避方法が紹介されていました。NSTextAttachmentCell経由で画像を突っ込む方法が紹介されています。

これにもとづいて修正+Shane Stanleyからのアドバイスで書き換えたのがこのScriptです。

AppleScript名:インライン画像つきスタイル付きテキストの作成 v1b.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/22
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

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

set anImage to (current application’s NSImage’s imageNamed:(current application’s NSImageNameComputer))

set anAttachment to current application’s NSTextAttachment’s alloc()’s init()
anAttachment’s attachmentCell()’s setImage:anImage
anAttachment’s setBounds:(current application’s NSMakeRect(0, 0, 32, 32))

set img1Str to current application’s NSAttributedString’s attributedStringWithAttachment:anAttachment

set anAssrStr to makeRTFfromParameters("Piyomaru Software", 32, "Times") of me

img1Str’s appendAttributedString:anAssrStr

dispAttrStr("Main message", "Sub message", img1Str, 400, 80) of tvLib

on makeRTFfromParameters(aStr as string, aFontSize as real, aFontName as string)
  set aVal1 to current application’s NSFont’s fontWithName:aFontName |size|:aFontSize
  
set aKey1 to (current application’s NSFontAttributeName)
  
  
set aVal2 to current application’s NSColor’s blackColor()
  
set aKey2 to (current application’s NSForegroundColorAttributeName)
  
  
set aVal3 to 0
  
set akey3 to (current application’s NSKernAttributeName)
  
  
set keyList to {aKey1, aKey2, akey3}
  
set valList to {aVal1, aVal2, aVal3}
  
set attrsDictionary to current application’s NSMutableDictionary’s dictionaryWithObjects:valList forKeys:keyList
  
  
set attrStr to current application’s NSMutableAttributedString’s alloc()’s initWithString:aStr attributes:attrsDictionary
  
return attrStr
end makeRTFfromParameters

★Click Here to Open This Script 

(Visited 52 times, 1 visits today)
Posted in dialog RTF | Tagged 10.13savvy 10.14savvy 10.15savvy | Leave a comment

CPUのバイトオーダーを取得

Posted on 7月 22, 2020 by Takaaki Naganoya

実行中のコンピュータ(多分Mac)のCPUのバイトオーダーを取得するAppleScriptです。

これまで、MacのCPUは68k(Big Endian)→PowerPC(Big Endian)→Intel(Little Endian)と来て、次はARM。

一応、IntelとArmは同じLittle Endianなので問題は少ないはずですが、ARM DTKをお持ちの方は試してコッソリ教えていただけるとありがたいです。

この情報がAppleScriptで取得できると何か「いいこと」があるかですが、別にメリットはありません。

ただ、CPUの名前が取得できると、処理速度を推測できてよいでしょう。Intel CPUに対してApple Silicon(ARM)がどの程度のパフォーマンスを発揮できるのか、実機が出てこないとわかりませんけれども。

PowerPCからIntelに変わったときには、先読みが深くなったためか(?)連番ファイルの処理で問題が出て、書き直しが必要になったことがありました。IntelからARMへの移行時には、iOS系のアプリケーションの操作を試みて問題が出たり、セキュリティ上の制限にひっかかったりすることでしょう。

AppleScript名:CPUのバイトオーダーを取得.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/22
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

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

set bRes to getByteOrder() of me
–> true –Little Endian

on getByteOrder()
  set aRes to do shell script "sysctl -n hw.byteorder"
  
if aRes = "4321" then
    return false –Big Endian (PowerPC)
  else
    return true –Little Endian (Intel, Arm..maybe)
  end if
end getByteOrder

★Click Here to Open This Script 

Shane Stanleyからの投稿です。こっちの方がシンプルでいいですね。

AppleScript名:CPUのバイトオーダーを取得 v2.scptd
—
–  Created by: Shane Stanley
–  Created on: 2020/07/23
—

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

set bRes to current application’s NSHostByteOrder() — 1 = little endian, 2 = big endian, 0 = unknown

★Click Here to Open This Script 

(Visited 206 times, 1 visits today)
Posted in shell script System | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSHostByteOrder | Leave a comment

macOS 11.0上のUTIのじっけん

Posted on 7月 18, 2020 by Takaaki Naganoya

macOS 11.0 Big Sur上でUTIまわりの機構が大幅に変更になり、従来のUTI関連の機構がDeprecatedになったため、新規導入されたUniformtypeIdentifiersフレームワークまわりをかるく調べてみました。

なーーんで、いまごろこんな根幹の部分をいじくり出したのかさっぱりわかりませんが、NSStringにファイルパス操作系とかUTI系とかの機能がごった煮の状態で突っ込まれているので、そのあたりを整理したかったのでしょうか(それなら話はわかる気がする)。

これまでiCloudを介してファイルをやりとりしていたmacOSとiOSが、同じファイルシステム上でファイルのやりとりを行い出すために整備が必要だったと見るべきか、予算が確保できたから工事しておこうという気になったのか。

最近はAppleの各種フレームワークのオンラインドキュメントのページで強制的にSwiftをデフォルトで表示するように変更されたことからも見て取れるように(調べ物していてものすごく邪魔なんですが)、Swiftの将来的なバージョンアップに合わせてAPIを整理しだしたのかもしれません。

# Swiftはプログラム書くのに記号が多く(C言語っぽすぎ)、言語仕様が雪だるま式に膨らんできて好きになれない

macOS 11.0ではまだ従来どおりのUTI系の機能が使えるようですが、それ以降で徐々に廃止に持って行かれるのでしょう。ただ、Dynamic UTI(実行時のコンピュータに書類を作成したソフトウェアが存在していない場合などに使われるUTI)まわりの機能が用意されていないあたりは機能が不完全な印象があります>UniformtypeIdentifiersフレームワーク

AppleScript名:UTI Test on Big Sur
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/18
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7" –Big Sur(11.00) or later
use framework "Foundation"
use framework "UniformtypeIdentifiers"
use scripting additions

set aType to current application’s UTType’s typeWithIdentifier:"com.apple.applescript.script-bundle"
set aLocDesc to aType’s localizedDescription() as string
–> "スクリプトバンドル"

set aVer to (aType’s publicType) as boolean
–> false

set aDec to (aType’s declared) as boolean
–> true

set aDyn to (aType’s dynamic) as boolean
–> false

set aURL to (aType’s supertypes)
–>
(*
(NSSet)
  <_UTCoreType 0x7fff8b467a80> com.apple.package,
  <_UTCoreType 0x7fff8b466ea0> public.item,
  <_UTCoreType 0x7fff8b466f40> public.directory,
  <_UTCoreType 0x7fff8b467aa0> com.apple.bundle
}
*)

–UTI上で同じレベルにあるものはconfirmsToTypeで調べてもtrueにならない
set bType to current application’s UTType’s typeWithIdentifier:"com.apple.applescript.script"
set aConf to (aType’s conformsToType:bType)
–> false

set cType to current application’s UTType’s typeWithIdentifier:"public.image"
set dType to current application’s UTType’s typeWithIdentifier:"public.png"
set bConf to (cType’s conformsToType:dType)
–> false

–UTI Treeで下位概念にあるもの(public.png)は上位概念のもの(public.image)にconfirmsToTypeで包含されていることを調査できる
set cConf to (dType’s conformsToType:cType)
–> true

★Click Here to Open This Script 

(Visited 143 times, 1 visits today)
Posted in UTI | Tagged 11.0savvy UTType | 1 Comment

アラートダイアログ上に印刷対象ページ一覧を表示して対象ページを指定

Posted on 7月 17, 2020 by Takaaki Naganoya

アラートダイアログ上にボタンタイプのチェックボックスを並べて、選択したボタンのタイトルを選択するAppleScriptです。

書類の印刷対象を、こまかくページ指定するために作成した部品です。

ヘルプボタンにより、全ボタンの選択/非選択状態を作り出せます。


▲Beta2でAlert Dialogのタイトルまわりが変更されたようですが、、、、うーーん。あと、選択状態をボタンの見かけから知ることができないですわー

AppleScript名:アラートダイアログ上に印刷対象ページ一覧を表示して対象ページを指定
— Created 2020-07-17 by Takaaki Naganoya
— 2020 Piyomaru Software

set aRes to selectByCheckbox("Select each printout page", "Selected pages are the target", 64, "Helvetica") of chooseSeqNum

script chooseSeqNum
  
  
use AppleScript version "2.5"
  
use scripting additions
  
use framework "Foundation"
  
use framework "AppKit"
  
  
property NSFont : a reference to current application’s NSFont
  
property NSView : a reference to current application’s NSView
  
property NSAlert : a reference to current application’s NSAlert
  
property NSColor : a reference to current application’s NSColor
  
property NSButton : a reference to current application’s NSButton
  
property NSOnState : a reference to current application’s NSOnState
  
property NSOffState : a reference to current application’s NSOffState
  
property NSTextField : a reference to current application’s NSTextField
  
property NSMutableArray : a reference to current application’s NSMutableArray
  
property NSButtonTypeOnOff : a reference to current application’s NSButtonTypeOnOff
  
property NSMutableDictionary : a reference to current application’s NSMutableDictionary
  
property NSRunningApplication : a reference to current application’s NSRunningApplication
  
property NSFontAttributeName : a reference to current application’s NSFontAttributeName
  
property NSKernAttributeName : a reference to current application’s NSKernAttributeName
  
property NSMutableParagraphStyle : a reference to current application’s NSMutableParagraphStyle
  
property NSLigatureAttributeName : a reference to current application’s NSLigatureAttributeName
  
property NSMutableAttributedString : a reference to current application’s NSMutableAttributedString
  
property NSUnderlineStyleAttributeName : a reference to current application’s NSUnderlineStyleAttributeName
  
property NSParagraphStyleAttributeName : a reference to current application’s NSParagraphStyleAttributeName
  
property NSForegroundColorAttributeName : a reference to current application’s NSForegroundColorAttributeName
  
  
property theResult : 0
  
property returnCode : 0
  
property cList : {} –Checkbox button object array
  
property bArray : {}
  
  
  
on selectByCheckbox(aMainMessage, aSubMessage, aMaxPage, myFont)
    set paramObj to {myMessage:aMainMessage, mySubMessage:aSubMessage, maxPage:aMaxPage, fontName:myFont}
    
–my chooseItemByCheckBox:paramObj –for Debugging
    
my performSelectorOnMainThread:"chooseItemByCheckBox:" withObject:(paramObj) waitUntilDone:true
    
–> {1, 3, 5, 7, 9, 11}
    
return cList
  end selectByCheckbox
  
  
on chooseItemByCheckBox:(paramObj)
    set aMainMes to (myMessage of paramObj) as string
    
set aSubMes to (mySubMessage of paramObj) as string
    
set aMaxPage to (maxPage of paramObj) as integer
    
set aFontName to (fontName of paramObj) as string
    
    
set cList to {}
    
    
set colNum to 10
    
set rowNum to (aMaxPage div 10) + 1
    
set aLen to (colNum * rowNum)
    
    
set aButtonCellWidth to 56
    
set aButtonCellHeight to 40
    
    
set viewWidth to aButtonCellWidth * colNum
    
set viewHeight to aButtonCellHeight * (rowNum + 1)
    
    
–define the matrix size where you’ll put the radio buttons
    
set matrixRect to current application’s NSMakeRect(0.0, 0.0, viewWidth, viewHeight)
    
set aView to NSView’s alloc()’s initWithFrame:(matrixRect)
    
    
set aCount to 1
    
set aFontSize to 24
    
set bArray to current application’s NSMutableArray’s new()
    
    
–Make Header (Month, Year)
    
set aCalList to makeSeqNumList(1, aMaxPage) of me
    
set aCount to 1
    
    
    
–Make Calendar (Calendar Body)
    
repeat with y from 1 to rowNum
      repeat with x from 1 to colNum
        –try
        
set j to (contents of item aCount of aCalList)
        
set tmpB to (NSButton’s alloc()’s initWithFrame:(current application’s NSMakeRect(((x – 1) * aButtonCellWidth), ((aLen – aCount) div colNum) * aButtonCellHeight, aButtonCellWidth, aButtonCellHeight)))
        
        (
tmpB’s setTitle:(j as string))
        (
tmpB’s setFont:(NSFont’s fontWithName:aFontName |size|:aFontSize))
        
–set attrTitle to makeRTFfromParameters((aCount as string), aFontName, aFontSize, 0, (aFontSize * 1.2)) of me
        
–(tmpB’s setAttributedTitle:(attrTitle))
        (
tmpB’s setShowsBorderOnlyWhileMouseInside:true)
        (
tmpB’s setAlignment:(current application’s NSCenterTextAlignment))
        (
tmpB’s setEnabled:(j ≠ ""))
        (
tmpB’s setTarget:me)
        (
tmpB’s setAction:("clicked:"))
        (
tmpB’s setButtonType:(NSButtonTypeOnOff))
        (
tmpB’s setHidden:(j = ""))
        
        (
tmpB’s setTag:(j))
        (
bArray’s addObject:tmpB)
        
        
set aCount to aCount + 1
        
if aCount > aMaxPage then exit repeat
        
–end try
      end repeat
      
if aCount > aMaxPage then exit repeat
    end repeat
    
    
–Select the first radio button item
    
–(tmpArray’s objectAtIndex:0)’s setState:(current application’s NSOnState)
    
set my theResult to {}
    
    (
aView’s setSubviews:bArray)
    
    
— set up alert  
    
set theAlert to NSAlert’s alloc()’s init()
    
tell theAlert
      its setMessageText:aMainMes
      
its setInformativeText:aSubMes
      
its addButtonWithTitle:"OK"
      
its addButtonWithTitle:"Cancel"
      
its setAccessoryView:aView
      
      
–for Help Button
      
its setShowsHelp:(true)
      
its setDelegate:(me)
      
    end tell
    
    
— show alert in modal loop
    
NSRunningApplication’s currentApplication()’s activateWithOptions:0
    
my performSelectorOnMainThread:"doModal:" withObject:(theAlert) waitUntilDone:true
    
if (my returnCode as number) = 1001 then error number -128
    
    
set bNumList to (bArray’s valueForKeyPath:"state") as list
    
–set cList to {}
    
repeat with i from 1 to aMaxPage
      set aFlag to (contents of item i of bNumList) as boolean
      
if aFlag = true then
        set the end of cList to contents of i
      end if
    end repeat
    
    
copy cList to bArray
  end chooseItemByCheckBox:
  
  
  
on doModal:aParam
    set (my returnCode) to aParam’s runModal()
  end doModal:
  
  
  
  
on clicked:aParam
    set aTag to (tag of aParam) as integer
    
–clicked
    
if aTag is not in (my theResult) then
      set the end of (my theResult) to aTag
    else
      set theResult to my deleteItem:aTag fromList:theResult
    end if
  end clicked:
  
  
  
  
on deleteItem:anItem fromList:theList
    set theArray to NSMutableArray’s arrayWithArray:theList
    
theArray’s removeObject:anItem
    
return theArray as list
  end deleteItem:fromList:
  
  
  
  
–1D List(数値)をsort / ascOrderがtrueだと昇順ソート、falseだと降順ソート
  
on sort1DNumList:theList ascOrder:aBool
    tell current application’s NSSet to set theSet to setWithArray_(theList)
    
tell current application’s NSSortDescriptor to set theDescriptor to sortDescriptorWithKey_ascending_(missing value, true)
    
set sortedList to theSet’s sortedArrayUsingDescriptors:{theDescriptor}
    
return (sortedList) as list
  end sort1DNumList:ascOrder:
  
  
  
–Help Button Clicked Event Handler
  
on alertShowHelp:aNotification
    set aRes to display dialog "Do you change all checkbox state?" buttons {"All Off", "All On", "Cancel"} default button 3 with icon 1
    
set bRes to (button returned of aRes) as string
    
    
if bRes = "All Off" then
      set bLen to bArray’s |count|()
      
set theResult to {}
      
repeat with i from 0 to bLen
        ((bArray’s objectAtIndex:i)’s setState:(current application’s NSOffState))
      end repeat
      
    else if bRes = "All On" then
      set bLen to bArray’s |count|()
      
set theResult to {}
      
repeat with i from 0 to bLen
        ((bArray’s objectAtIndex:i)’s setState:(current application’s NSOnState))
        
set the end of theResult to i + 1
      end repeat
    end if
    
    
return false –trueを返すと親ウィンドウ(アラートダイアログ)がクローズする
  end alertShowHelp:
  
  
  
  
–書式つきテキストを組み立てる
  
on makeRTFfromParameters(aStr as string, fontName as string, aFontSize as real, aKerning as real, aLineSpacing as real)
    set aVal1 to NSFont’s fontWithName:fontName |size|:aFontSize
    
set aKey1 to (NSFontAttributeName)
    
    
set aVal2 to NSColor’s blackColor()
    
set aKey2 to (NSForegroundColorAttributeName)
    
    
set aVal3 to aKerning
    
set akey3 to (NSKernAttributeName)
    
    
set aVal4 to 0
    
set akey4 to (NSUnderlineStyleAttributeName)
    
    
set aVal5 to 2 –all ligature ON
    
set akey5 to (NSLigatureAttributeName)
    
    
set aParagraphStyle to NSMutableParagraphStyle’s alloc()’s init()
    
aParagraphStyle’s setMinimumLineHeight:(aLineSpacing)
    
aParagraphStyle’s setMaximumLineHeight:(aLineSpacing)
    
set akey7 to (NSParagraphStyleAttributeName)
    
    
set keyList to {aKey1, aKey2, akey3, akey4, akey5, akey7}
    
set valList to {aVal1, aVal2, aVal3, aVal4, aVal5, aParagraphStyle}
    
set attrsDictionary to NSMutableDictionary’s dictionaryWithObjects:valList forKeys:keyList
    
    
set attrStr to NSMutableAttributedString’s alloc()’s initWithString:aStr attributes:attrsDictionary
    
return attrStr
  end makeRTFfromParameters
  
  
  
on makeNSTextField(xPos as integer, yPos as integer, myWidth as integer, myHeight as integer, editableF as boolean, setVal as string, backgroundF as boolean, borderedF as boolean)
    set aNSString to NSTextField’s alloc()’s initWithFrame:(current application’s NSMakeRect(xPos, yPos, myWidth, myHeight))
    
aNSString’s setEditable:(editableF)
    
aNSString’s setStringValue:(setVal)
    
aNSString’s setDrawsBackground:(backgroundF)
    
aNSString’s setBordered:(borderedF)
    
return aNSString
  end makeNSTextField
  
  
  
  
on makeSeqNumList(fromNum as integer, toNum as integer)
    script spd
      property aList : {}
    end script
    
    
set aList of spd to {}
    
    
repeat with i from fromNum to toNum
      set the end of (aList of spd) to i
    end repeat
    
    
return (aList of spd)
  end makeSeqNumList
  
  
end script

★Click Here to Open This Script 

(Visited 54 times, 1 visits today)
Posted in dialog | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSAlert NSButton NSButtonTypeOnOff NSColor NSFont NSFontAttributeName NSForegroundColorAttributeName NSKernAttributeName NSLigatureAttributeName NSMutableArray NSMutableAttributedString NSMutableDictionary NSMutableParagraphStyle NSOffState NSOnState NSParagraphStyleAttributeName NSRunningApplication NSTextField NSUnderlineStyleAttributeName NSView | Leave a comment

Kamenoko v1.1のMac Pro 2019バグ対策機能が効果を発揮

Posted on 7月 16, 2020 by Takaaki Naganoya

現在Mac App Storeで販売中のKamenoko v1.1には、Mac Pro 2019上でだけ症状が確認されているバグへの対策機能が盛り込まれています。

Mac Pro 2019は三角関数の簡単な計算を間違える「問題マシン」として認識しています(実機ないんで、細かい挙動はわかりません)。

「おそらくこう対策すれば回避できるはず」と想像された方法で機能を実装し、v1.1を動かしたMac Pro 2019ユーザーの知り合いから「大丈夫」との実機確認報告をいただきました。


▲Mac Pro 2019上でのみ報告されているHex Grid座標計算バグ(Kamenoko v1.0+macOS 10.15.5?)

Mac Pro 2019上でのみ、この6角形セルの座標計算でミスが生じることが報告されています。この座標計算はJavaScript Coreの機能をAppleScriptから呼び出して行なっているもので、このJavaScript Coreの関数演算で計算結果に誤差(ないし、想定外の高い計算精度)が発生。

このため、Kamenoko v1.1ではMac Pro 2019対策として各六角形の座標値をあらかじめ計算し、固定データとして保持して使用しています。内部的には、起動時に座標値をすべて計算してNSBezierPathを作ってキャッシュして(作成後の変更なしに)使っていたので、とくに処理フローが大幅に変わったわけではありません。


▲Mac Pro 2019上で動作しているKamenoko v1.1の想像図(実機ないんで)

この関数演算バグがMac Pro 2019上でのみ発生するものなのか、それともXeon搭載機で同様に発生するものなのかは未確認です。

(Visited 60 times, 1 visits today)
Posted in Bug PRODUCTS | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Kamenoko | Leave a comment

Kamenoko v1.1をMac App Storeで公開

Posted on 7月 13, 2020 by Takaaki Naganoya

Mac App Storeに「Kamenoko」の本命と位置付けているv1.1をアップロードしました。Mac App Storeへのアップに何も問題なく終わったということはなかったので、今回も何回かのやりとりが必要と思われます。

→ 今回はすぐにレビューを通過しました Now On Saleです

内容をほぼすべてAppleScriptで記述してありますが、本アプリケーションはScriptableではありません。それは、このv1.1でも同様です。

Kamenokoのアプリケーション設計段階で、本アプリケーションのAppleScript対応はあまり考えられませんでした。どちらかといえば、本アプリケーションの書類を一括で書き換えるなどの処理が適していると思われました。

このためには、書類操作用のAppleScriptライブラリを内蔵し、それをAppleScriptで呼び出すスタイルが適していると思われました。

本バージョンもまだAppleScript Libraryは内蔵していませんが、今後のバージョンでの対応を行いたいところです。なぜなら、もう単体でライブラリ自体は動いているからです。

(Visited 36 times, 1 visits today)
Posted in PRODUCTS | Tagged 10.13savvy 10.14savvy 10.15savvy Kamenoko | Leave a comment

iWork Appがv10.1にアップデートし、Movie書き出しバグの修正とPDF書き出し属性を追加

Posted on 7月 10, 2020 by Takaaki Naganoya

iWorkアプリケーション(Keynote、Numbers、Pages)がアップデートされてv10.1になりました。対象はmacOS 10.14/10.15。

AppleScript系ではバグ修正1点と、機能追加が1点あります。

Keynoteのムービー書き出しオプション(native size)バグ修正

Keynote v10.0の際のアホなバグ(native size指定時にエラー)が修正されました。

AppleScript名:native sizeでムービー書き出し
set outFile to (path to desktop as string) & (do shell script "uuidgen") & ".m4v"

tell application "Keynote"
  tell front document
    export to file outFile as QuickTime movie with properties {class:export options, movie format:native size}
  end tell
end tell

★Click Here to Open This Script 

PDF書き出しオプション(include comments)を追加

また、3アプリケーション共通でPDF書き出し時に「include comments」オプションが指定できるようになりました。


▲include comments属性が追加された


▲Keynote書類に追加した「コメント」


▲KeynoteのGUI上で指定する「コメントを含める」チェックボックス


▲上がinclude comments:falseで書き出したPDF、下がinclude comments:trueで書き出したPDF

AppleScript名:Keynote書類からPDF書き出し v3(10.10対応)
— Created 2017-01-21 by Takaaki Naganoya
— Modified 2020-07-10 by Takaaki Naganoya
— 2017-2020 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set tmpPath to (path to desktop) as string
set aRes to exportKeynoteDocToPDF(tmpPath)

–Keynote書類からPDF書き出し
on exportKeynoteDocToPDF(targFolderPath as string)
  
  
tell application "Keynote"
    set dCount to count every document
    
if dCount = 0 then
      return false
    end if
    
set aPath to file of document 1
  end tell
  
  
set curPath to (current application’s NSString’s stringWithString:(POSIX path of aPath))’s lastPathComponent()’s stringByDeletingPathExtension()’s stringByAppendingString:".pdf"
  
set outPath to (targFolderPath & curPath)
  
  
tell application "Keynote"
    –v10.10で追加されたinclude comments属性の指定を追加してみた
    
set anOpt to {class:export options, export style:IndividualSlides, all stages:false, skipped slides:true, PDF image quality:Best, include comments:false}
    
export document 1 to file outPath as PDF with properties anOpt
  end tell
  
  
return (outPath as alias)
  
end exportKeynoteDocToPDF

★Click Here to Open This Script 

iWorkアプリケーションのAppleScript系機能に望むこと

・slide上の選択中のオブジェクトを扱えるようにしてほしい(selected itemといった予約語で)
・縦書きテキストの制御機能がほしい(強引に作ったけど)
・TOCつきPDFが直接書き出せるように(自分で作ったけど)
・Pagesをなんとかして。レイアウトをScriptから再現できない

(Visited 67 times, 1 visits today)
Posted in Bug PDF | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | Leave a comment

辞書.appで指定の単語を検索する v3

Posted on 7月 9, 2020 by Takaaki Naganoya

辞書.appで指定の単語を検索するAppleScriptです。

辞書.app(Dictionary.app)にはAppleScript用語辞書が存在していませんが、URL event経由で検索・表示できるほか、サードパーティのFramework経由でも串刺し検索できるようになっています。

URL eventはApple側から最もセキュリティ面で懸念されている箇所であり、以前はURL event経由でアプリケーション起動もできたのですが、いまはURL event経由のアプリケーション起動は(ごく一部の例外を除き)禁止されている様子です。

ただし、OSバージョンが上がるたびに微妙に辞書名称が変更されており、定数で指定されることに対して微妙にAppleのエンジニアが嫌がらせをしている様子が伺えます。

AppleScript名:辞書.appで指定の単語を検索する v3
— Created 2017-09-19 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aText to text returned of (display dialog "Input keyword to search" default answer "")
set encText to encodeURL(aText) of me
activate application "Dictionary"

set aURL to "dict://" & encText
open location aURL

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

★Click Here to Open This Script 

Shaneからツッコミが入って「stringByAddingPercentEscapesUsingEncoding: はdeprecatedだよー」とのこと。こんな細かいところでAPIが入れ替わっているとはおそろしいところです。

AppleScript名:辞書.appで指定の単語を検索する v4
— Created 2017-09-19 by Takaaki Naganoya
— Modified 2020-07-09 by Shane Stanley
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aText to text returned of (display dialog "Input keyword to search" default answer "")
set encText to encodeURL(aText) of me
activate application "Dictionary"

set aURL to "dict://" & encText
open location aURL

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 URLHostAllowedCharacterSet())
  
–It’s just that stringByAddingPercentEscapesUsingEncoding: is deprecated.
  
return encodedStr as string
end encodeURL

★Click Here to Open This Script 

(Visited 41 times, 1 visits today)
Posted in URL | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Dictionary.app | Leave a comment

指定ファイルのメタデータ表示 v2

Posted on 7月 7, 2020 by Takaaki Naganoya

指定ファイルのメタデータをTable UIで表示するAppleScriptです。

テーブル表示用のライブラリ「display table by list」のアップデート版(v1.3)を利用しています。同ライブラリは特定用途のために間に合わせで作っただけだったので、バグを直して汎用性を高めました(無駄なウィンドウの半透明表示をやめた)。また、アイコン表示用のURL指定を省略したときにエラーになる点を修正しました。

–> Download displayTable.scptd(AppleScript Library)

データのテキスト化ライブラリ「everythingToText」も利用していますが、これソースもオープンにしていてよく使っているのですが、とくに決まったURLから配布というのは行なっていませんね。機能が素朴すぎてライブラリとして配布するのがためらわれるところです。

–> Download displayMetadataByTablev2

というわけで、ライブラリを含んだScript Bundleをダウンロードできるようにしておきました(↑)。

AppleScript名:指定ファイルのメタデータ表示 v2.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/07
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
use easyTable : script "display table by list"
use eText : script "everythingToTextKit"

property |NSURL| : a reference to current application’s |NSURL|
property NSMetadataItem : a reference to current application’s NSMetadataItem

set aFile to choose file
set aPOSIX to POSIX path of aFile
set aURL to |NSURL|’s fileURLWithPath:(aPOSIX)
set aMetaInfo to NSMetadataItem’s alloc()’s initWithURL:aURL
set attrList to (aMetaInfo’s attributes()) as list

set aList to {}
repeat with i in attrList
  set metaDict to (aMetaInfo’s valuesForAttributes:{i as string}) as record
  
set recStr to convToStr(metaDict) of eText
  
set the end of aList to {i as string, recStr as string}
  
–set the end of aList to (recStr as string)
end repeat

set fLabels to {"Attribute", "Value"}

set aRes to (display table by list aList main message "Metadata" sub message aPOSIX size {1200, 800} labels fLabels)

★Click Here to Open This Script 

(Visited 55 times, 1 visits today)
Posted in dialog file Metadata | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSMetadataItem NSURL | Leave a comment

指定TTSボイスキャラクタの読み上げ例文テキストを取得

Posted on 7月 6, 2020 by Takaaki Naganoya

指定のテキスト読み上げ(Text To Speech)ボイスキャラクターの読み上げ例文テキストを取得して実際に読み上げるAppleScriptです。

TTS音声は言語や性別、年齢、高音質かどうかなどの情報を持っているので、これらを指定して絞り込むことが可能です。また、指定TTS音声キャラクターの例文テキストもこのように取得できます。

AppleScript名:指定TTSボイスキャラクタの読み上げ例文テキストを取得.scpt
— Created 2015-08-25 by Takaaki Naganoya
— Modified 2015-08-26 by Shane Stanley, Takaaki Naganoya
— Modified 2020-07-06 by Takaaki Naganoya
— 2020 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"
use scripting additions

set vList to getVoiceNames() of me
using terms from scripting additions
  set aTargTTSVoiceName to contents of (choose from list vList)
end using terms from

using terms from scripting additions
  set v1Res to getDemoText(aTargTTSVoiceName) of me
  
say v1Res using aTargTTSVoiceName
end using terms from

–Get TTS Voice sample text
on getDemoText(aName as string)
  set vList to getVoiceNames() of me
  
if aName is not in vList then return ""
  
set anID to getSpecifiedVoiceIDfromVoiceName(aName) of me
  
  
set aDemoText to ((current application’s NSSpeechSynthesizer’s attributesForVoice:anID)’s VoiceDemoText)
  
return aDemoText as string
end getDemoText

–Get all voice names
on getVoiceNames()
  –Make Blank Array
  
set outArray to current application’s NSMutableArray’s arrayWithObject:{}
  
set aList to {}
  
  
–Make Installed Voice List
  
set nameList to current application’s NSSpeechSynthesizer’s availableVoices()
  
repeat with i in nameList
    set j to contents of i
    
    
set aDic to ((current application’s NSSpeechSynthesizer’s attributesForVoice:j))
    
    
set aDemoText to (aDic’s VoiceDemoText) as string
    
set aName to (aDic’s VoiceName) as string
    
    
set the end of aList to aName
  end repeat
  
  
return aList as list
end getVoiceNames

–Voice Name –> Voice ID
on getSpecifiedVoiceIDfromVoiceName(VoiceName as string)
  set outArray to current application’s NSMutableArray’s arrayWithObject:{}
  
  
set aList to current application’s NSSpeechSynthesizer’s availableVoices()
  
set bList to aList as list
  
  
repeat with i in bList
    set j to contents of i
    
set aDic to (current application’s NSSpeechSynthesizer’s attributesForVoice:j)
    (
outArray’s addObject:aDic)
  end repeat
  
  
–Filter Voice
  
set aPredicate to current application’s NSPredicate’s predicateWithFormat_("VoiceName == %@", VoiceName)
  
  
set filteredArray to outArray’s filteredArrayUsingPredicate:aPredicate
  
set aReList to (filteredArray’s valueForKey:"VoiceIdentifier") as list
  
  
if length of aReList = 1 then
    return first item of aReList
  else
    return ""
  end if
end getSpecifiedVoiceIDfromVoiceName

★Click Here to Open This Script 

(Visited 144 times, 1 visits today)
Posted in list Record System Text to Speech | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSMutableArray NSPredicate NSSpeechSynthesizer | Leave a comment

指定のKeynote書類のタイプを求める

Posted on 7月 5, 2020 by Takaaki Naganoya

指定のKeynote書類がフラット形式かバンドル形式かを取得するAppleScriptです。

UTIを取得してみたら簡単に判定できたので、これでいいでしょう。バンドル形式かどうかを判定するために、ディレクトリ構造を仮定したパスを組み立てて、アクセスしてみることも検討したのですが、UTIを求めるだけですみました。

AppleScript名:指定のKeynote書類のタイプを求める.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/05
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set aFilePath to choose file of type {"com.apple.iwork.keynote.key", "com.apple.iwork.keynote.sffkey"}
set aUTI to getUTIfromPath(aFilePath) of me
–> "com.apple.iwork.keynote.key" (Bundle)
–> "com.apple.iwork.keynote.sffkey" (Flat)

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 ""
  
set aRes to aURL’s resourceValuesForKeys:{current application’s NSURLTypeIdentifierKey} |error|:(missing value)
  
if aRes = missing value then return ""
  
return (aRes’s NSURLTypeIdentifierKey) as string
end getUTIfromPath

★Click Here to Open This Script 

AppleScript名:指定のKeynote書類のタイプを求める v2.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/05
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set aFilePath to choose file of type {"com.apple.iwork.keynote.key", "com.apple.iwork.keynote.sffkey"}
set aUTI to getUTIfromPath(aFilePath) of me
set aKType to retKeynoteBundleOrNot(aUTI) of me
–> "Flat Keynote"
–> "Bundle Package Keynote"

on retKeynoteBundleOrNot(anUTI)
  if anUTI = "com.apple.iwork.keynote.sffkey" then
    return "Flat Keynote"
  else if anUTI = "com.apple.iwork.keynote.key" then
    return "Bundle Package Keynote"
  else
    return false
  end if
end retKeynoteBundleOrNot

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 ""
  
set aRes to aURL’s resourceValuesForKeys:{current application’s NSURLTypeIdentifierKey} |error|:(missing value)
  
if aRes = missing value then return ""
  
return (aRes’s NSURLTypeIdentifierKey) as string
end getUTIfromPath

★Click Here to Open This Script 

(Visited 39 times, 1 visits today)
Posted in file UTI | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSURL NSURLTypeIdentifierKey | Leave a comment

linked listとvector

Posted on 7月 5, 2020 by Takaaki Naganoya

今日その存在を初めて知りました。linked listとvector。2020年になって知らない予約語があったとは、目が覚めるような思いです。

AppleScriptの隠れ予約語なんだとか。たまにこういう「隠れ仕様」が転がっていて息が止まりそうになります。

set x to {{{1, 2, 3}}} as linked list
--> {1,2,3}

リストの一種らしいのですが、Language Guideにも掲載されていないので、正直よくわかりません。

不用意に多次元化してしまったlistを最低限の次元に落としてくれるようです(linked list)。

かといって、有効活用したいとかいうことは考えないほうがいいようです(Apple側でも検証していないでしょうね、いろんなランタイム環境での実行内容とか)。

set x to {{{1, 2, 3}}} as linked list
--> {1,2,3}

set a to length of x
--> 3

set b to class of x
--> list

--set the end of x to 4
--> error "end of {1, 2, 3}を4に設定できません。" number -10006 from last insertion point of {1, 2, 3}

--set beginning of x to 0
--> error "beginning of {1, 2, 3}を0に設定できません。" number -10006 from insertion point 1 of {1, 2, 3}

set x to x & 6
--> {1, 2, 3, 6}

vectorもlinked list同様な感じではあるものの、要素をbeginningとendに追加できるようで。

set aVec to {{{1, 2, 3}}} as vector
set aLen to length of aVec
--> 1

set aClass to class of aVec
--> list

set the beginning of aVec to 0
--> {0, {{1, 2, 3}}}

set the end of aVec to 9
--> {0, {{1, 2, 3}}, 9}

不定クラスの予約語「anything」もその筋での評判がよろしくありません。macOS 10.14以降のスクリプトエディタでようやく誤解釈されなくなりましたが、それまではASObjC環境で「list of string or string」と解釈されてしまっていました。一方でScript Debugger上では「any」と解釈され、足並みが揃っていません。

明確に予約語がないにもかかわらず、機能が実装されているのが「as «class utf8»」。機能がないと致命的に問題が出るので、なくなることはないと思います。

edama2さんと本件について雑談していたら、「見かけたことがある」とのことで、その場で調べてみたら見つかりました。

http://mtlab.ecn.fpu.ac.jp/WSM_1999/990521193527.html

(Visited 80 times, 1 visits today)
Posted in How To list | Tagged 10.14savvy 10.15savvy 11.0savvy | 1 Comment

Numbers書類からExcel書き出し

Posted on 7月 4, 2020 by Takaaki Naganoya

Numbers書類をExcel形式(.xlsx)で書き出すAppleScriptです。

とりあえず動作確認のために作っただけだったので、動作は最低限のものです。Numbersでオープン中のNumbers書類をExcel形式に書き出します。それだけです。処理対象は1つのシートのみ含んでいる書類に限っています。Numbers書類のオープンや書き出した書類のクローズは別途作成してください。

Numbers書類でシートが複数存在しているものをExcel書類に書き出すと、各シートへのリンクが含まれたインデックスが1枚追加されます。このインデックスは非常に親切でよいのですが、割と邪魔です。あとでScript側から削除することも可能ですが、自分はNumbersから書き出す際に複数シートの書類は書き出さないようにまとめてみました。

もちろん、これはルーチンを整備して実際に使う人の考えによるものなので、別の人はNumbersの複数シートを含む書類をそのままExcel書類に変換されてもいいと考えるかもしれないですし、処理時に複数のシートを個別のNumbers書類に分割するような処理を書いてもいいでしょう。

実際にNumbersを使っていて、あまりExcel書き出しは必要にならなかったので「できる」ことは知っていながらも書かなかった処理ではあります。

AppleScript名:Numbers書類からExcel書き出し
— Created 2017-03-28 by Takaaki Naganoya
— Modified 2020-07-02 by Takaaki Naganoya
— 2020 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set tmpPath to (path to desktop) as string
set aRes to exportNumbersDocToExcel(tmpPath) of me

–Numbers書類をExcel書き出し
on exportNumbersDocToExcel(targFolderPath as string)
  tell application "Numbers"
    set dCount to count every document
    
if dCount = 0 then
      return false
    end if
    
    
–複数のシートが存在していると書き出せないことはないが、リンク付きの凝ったExcelシートになる
    
tell front document
      set sCount to count every sheet
      
if sCount = 0 or sCount > 1 then
        return false
      end if
    end tell
    
    
set aPath to file of document 1
  end tell
  
  
set curPath to (current application’s NSString’s stringWithString:(POSIX path of aPath))’s lastPathComponent()’s stringByDeletingPathExtension()’s stringByAppendingString:".xlsx"
  
set outPath to (targFolderPath & curPath)
  
–このあと、安全のために重複パスの回避ルーチンを呼んでおくといいでしょう
  
  
tell application "Numbers"
    set anOpt to {class:export options, image quality:Best}
    
export document 1 to file outPath as Microsoft Excel with properties anOpt
    
return true
  end tell
end exportNumbersDocToExcel

★Click Here to Open This Script 

(Visited 186 times, 1 visits today)
Posted in file | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Numbers | Leave a comment

Keynote書類上の画像を実パスを求めてアーカイブ展開してオープン

Posted on 7月 4, 2020 by Takaaki Naganoya

Keynote書類上の指定画像のアーカイブ中のパスを求め、指定画像のファイル名と照合し、当該画像ファイルのみアーカイブ展開してからPreview.appでオープンするAppleScriptです。

Keynote書類には2つの形式(パッケージ形式、フラット形式)があり、現在のデフォルトはフラット形式です。

パッケージ形式についてはFinder上でパッケージバンドルを表示させて、内部データ構造を実際に見られるようになっています。

では、フラット形式はどうかといえば、上記のパッケージ形式データをZip圧縮して拡張子を「.key」に変更したものです。

そのため、拡張子を「.key」から「.zip」に付け替えて、アーカイブ展開すると、実際にパッケージ内部のファイルにアクセスできます。

本Scriptは、フラット形式のKeynote書類に対して動作します。パッケージ形式は想定していません(パッケージ形式は単にファイル構造にアクセスすればよいだけなので)。

画像を貼り付けたスライドを表示した状態で本AppleScriptを実行すると、スライド上に貼り付けた画像をデスクトップフォルダに展開し、Previw.appでオープンします。1回実行するとデスクトップに画像ファイルの名前のフォルダが作られ、その中に画像が展開されています。この状態でScriptを再実行すると、フォルダ名が重複するためエラーになります。再実行したい場合にはデスクトップ上の画像名のフォルダを削除しておいてください。

指定Keynote書類の、指定スライド上にある指定イメージについては、ファイル名がわかるだけでパスやデータを取得できるわけではありません。

そこで、フラット形式のKeynote書類中の画像一覧を取得し、このファイル名と符合するものをピックアップします。ただし、ファイル名が完全一致するわけではなく、オリジナルのファイル名が「someImage.png」だった場合に、「someImage-221.png」といったファイル名が見つかります。

また、見つかるのは実ファイルだけでなくプレビュー用の「someImage-small-221.png」といったものも入っています。このプレビュー用イメージについてはスキップしています。

その後、さまざまな処理を行なってもよいでしょうけれども、とりあえず現状ではPreview.appでファイルをオープンしています。

AppleScript名:Keynote書類上の画像をアーカイブ展開して実パスを求めて展開.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2020/07/04
—
–  Copyright © 2020 Piyomaru Software, All Rights Reserved
—

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

tell application "Keynote"
  set dCount to count (every document)
  
if dCount = 0 then return
  
  
tell front document
    set myPath to (file of it)
    
if myPath = missing value then return false –Unsaved
    
    
tell current slide
      tell image 1
        set aFile to file name
        
–> "switchControl.png"
      end tell
    end tell
  end tell
end tell

set myPOSIXPath to POSIX path of (myPath as alias)

–Extract document internal image paths by extracting Keynote’s zip archive
set dList to getInternalImagesWithinKeynote(myPath) of me

–Extract file name and ext from image 1 path
set pPath to POSIX path of aFile
set {aName, aExt} to getExtAndFilenameFromPath(pPath) of me

–Filter Keynote internal image list by image 1’s file name and ext
set theArray to current application’s NSArray’s arrayWithArray:dList
set thePred to current application’s NSPredicate’s predicateWithFormat_("self.pathExtension == %@ && self.lastPathComponent beginswith %@ ", aExt, aName)
set bList to (theArray’s filteredArrayUsingPredicate:thePred) as list
–> {"Data/switchControl-226.png", "Data/switchControl-small-227.png"}

–Extrat file
set exF to false

repeat with i in bList
  set outName to getFilenameAndExtFromPath(i) of me
  
  
if outName does not contain "-small-" then –Skip Preview Image
    set outPath to POSIX path of (path to desktop) & outName
    
set bRes to do shell script "unzip -j " & quoted form of myPOSIXPath & " " & quoted form of i & " -d " & " " & outPath
    
    
set extractPath to POSIX path of (path to desktop) & outName & "/" & outName
    
do shell script "open " & quoted form of extractPath –Open for test
    
    
set exF to true
  end if
end repeat

if exF = false then return false

–Keynote書類中の画像ファイル一覧を取得
on getInternalImagesWithinKeynote(myPath)
  set kPath to POSIX path of myPath
  
set aRes to do shell script "unzip -Z1 " & quoted form of kPath & " | grep ^Data/"
  
set aList to paragraphs of aRes
  
return aList
end getInternalImagesWithinKeynote

–ファイルパスからファイル名部分と拡張子を分離
on getExtAndFilenameFromPath(aPOSIXpath)
  set pathString to current application’s NSString’s stringWithString:aPOSIXpath
  
set aStr to pathString’s lastPathComponent()
  
set aExt to (aStr’s pathExtension())
  
set bStr to aStr’s stringByDeletingPathExtension()
  
return {bStr as string, aExt as string}
end getExtAndFilenameFromPath

–ファイルパスからファイル名部分のみ取得
on getFilenameAndExtFromPath(aPOSIXpath)
  set pathString to current application’s NSString’s stringWithString:aPOSIXpath
  
set aStr to pathString’s lastPathComponent()
  
return aStr as string
end getFilenameAndExtFromPath

★Click Here to Open This Script 

(Visited 93 times, 1 visits today)
Posted in file Image list | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Keynote | Leave a comment

Post navigation

  • Older posts

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

Google Search

Popular posts

  • AppleScriptによるWebブラウザ自動操縦ガイド
  • macOS 13, Ventura(継続更新)
  • ドラッグ&ドロップ機能の未来?
  • macOS 12.x上のAppleScriptのトラブルまとめ
  • PFiddlesoft UI Browserが製品終了に
  • macOS 12.3 beta 5、ASの障害が解消される(?)
  • SF Symbolsを名称で指定してPNG画像化
  • 新刊発売:AppleScriptによるWebブラウザ自動操縦ガイド
  • macOS 12.3 beta4、まだ直らないASまわりの障害
  • macOS 12.3上でFinder上で選択中のファイルをそのままオープンできない件
  • Safariで表示中のYouTubeムービーのサムネイル画像を取得
  • macOS 12のスクリプトエディタで、Context Menu機能にバグ
  • Pixelmator Pro v2.4.1で新機能追加+AppleScriptコマンド追加
  • 人類史上初、魔導書の観点から書かれたAppleScript入門書「7つの宝珠」シリーズ開始?!
  • CotEditor v4.1.2でAppleScript系の機能を追加
  • macOS 12.5(21G72)がリリースされた!
  • UI Browserがgithub上でソース公開され、オープンソースに
  • Pages v12に謎のバグ。書類上に11枚しか画像を配置できない→解決
  • 新発売:AppleScriptからSiriを呼び出そう!
  • iWork 12.2がリリースされた

Tags

10.11savvy (1102) 10.12savvy (1243) 10.13savvy (1391) 10.14savvy (586) 10.15savvy (434) 11.0savvy (274) 12.0savvy (174) 13.0savvy (34) CotEditor (60) Finder (47) iTunes (19) Keynote (97) NSAlert (60) NSArray (51) NSBezierPath (18) NSBitmapImageRep (21) NSBundle (20) NSButton (34) NSColor (51) NSDictionary (27) NSFileManager (23) NSFont (18) NSImage (42) NSJSONSerialization (21) NSMutableArray (62) NSMutableDictionary (21) NSPredicate (36) NSRunningApplication (56) NSScreen (30) NSScrollView (22) NSString (118) NSURL (97) NSURLRequest (23) NSUTF8StringEncoding (30) NSUUID (18) NSView (33) NSWorkspace (20) Numbers (55) Pages (36) Safari (41) Script Editor (20) WKUserContentController (21) WKUserScript (20) WKWebView (23) WKWebViewConfiguration (22)

カテゴリー

  • 2D Bin Packing
  • 3D
  • AirDrop
  • AirPlay
  • Animation
  • AppleScript Application on Xcode
  • beta
  • Bluetooth
  • Books
  • boolean
  • bounds
  • Bug
  • Calendar
  • call by reference
  • Clipboard
  • Code Sign
  • Color
  • Custom Class
  • dialog
  • drive
  • 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
  • Machine Learning
  • Map
  • Markdown
  • Menu
  • Metadata
  • MIDI
  • MIME
  • Natural Language Processing
  • Network
  • news
  • Noification
  • Notarization
  • Number
  • Object control
  • OCR
  • OSA
  • PDF
  • Peripheral
  • PRODUCTS
  • QR Code
  • Raw AppleEvent Code
  • Record
  • 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)
  • 未分類

アーカイブ

  • 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