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

Keynoteで選択中のオブジェクトをテキストとサイズを元に特定する

Posted on 3月 16, 2021 by Takaaki Naganoya

Keynoteの最前面の書類の現在表示中のスライドで選択中のオブジェクトの情報を、テキスト(object text)と幅(width)、高さ(height)から特定するAppleScriptです。

KeynoteのAppleScript用語辞書に「selected item」といった予約語がなく、現在のスライド上の「選択中のオブジェクト」を取得する機能が存在していません。一応、「selection」という予約語はあるのですが、これが有効なのは「選択中のスライド」(複数選択可)なので、本来やりたい「選択中のテキストアイテムからリンク情報を消去」といった処理ができません。

その下調べで作ってみました。

以前、選択中のオブジェクトのテキスト(object text)を取得するScriptを書いたことはあったのですが、それはあくまでテキストを取得するだけで、元のスライド上のオブジェクトのどれが該当するかという処理は行なっていませんでした。

そこで、選択中のオブジェクト(だいたいテキストアイテムが目標)をテキスト(object text)、オブジェクトの幅と高さで比較して特定するようにしてみました。例によってCopy & Pasteで新規書類にペーストして情報を調べるため、GUI Scriptingがオンになっている必要があります。

本Scriptの実行前にKeynote書類上のオブジェクトを選択しておく必要があります。

AppleScript名:選択中のオブジェクトをテキストとサイズを元に特定する.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/01/27
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

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

–選択中のオブジェクト(Text Frameを想定)をコピペで取得する
set kList to getEveryTextFromCurrentKeynoteSlide() of me

set out2List to {}

–取得した情報をもとに元書類からデータを特定する
tell application "Keynote"
  tell front document
    tell current slide
      repeat with i in kList
        copy i to {tmpTitle, tmpW, tmpH}
        
try
          set bList to (every iWork item whose object text is equal to tmpTitle and width of it is equal to tmpW and height of it is equal to tmpH)
          
set tmpItem to first item of bList
          
set the end of out2List to tmpItem
        on error
          log {"Something Wrong with an item", tmpTitle, tmpW, tmpH}
        end try
      end repeat
    end tell
  end tell
end tell

return out2List
–> {text item 4 of slide 179 of document id "E3EFE83C-A691-4D99-8939-6928892CBED5"}

–選択中のオブジェクトをコピーして新規書類にペーストしてオブジェクト情報(テキスト、幅、高さ)を返す
on getEveryTextFromCurrentKeynoteSlide()
  tell application "Keynote"
    activate
    
    
set dCount to count every document
    
if dCount = 0 then
      display notification "There is no Keynote document"
      
return {}
    end if
    
    
tell front document
      set sCount to count every slide
    end tell
    
if sCount = 0 then
      display notification "There is no Slide in Keynote document"
      
return {}
    end if
    
  end tell
  
  
–Copy
  
tell application "System Events"
    keystroke "c" using {command down}
  end tell
  
  
  
tell application "Keynote"
    activate
    
set nDoc to make new document
    
tell nDoc
      set aMaster to master slide "空白"
      
–set aMaster to master slide "Blank"
      
      
tell current slide
        set base slide to aMaster
      end tell
    end tell
    
  end tell
  
  
–Paste
  
tell application "System Events"
    keystroke "v" using {command down}
  end tell
  
  
delay 0.01 –Important!!
  
  
set tOut to {}
  
tell application "Keynote"
    tell front document
      tell current slide
        set tList to every iWork item
        
        
repeat with i in tList
          set tmpText to (object text of i) as string
          
set tmpHeight to height of i
          
set tmpWidth to width of i
          
          
set the end of tOut to {tmpText, tmpWidth, tmpHeight}
        end repeat
        
      end tell
    end tell
    
    
–Dispose document
    
tell front document
      close without saving
    end tell
  end tell
  
  
return tOut
end getEveryTextFromCurrentKeynoteSlide

on retDelimedText(aList, aDelim)
  set aText to ""
  
set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to aDelim
  
set aText to aList as text
  
set AppleScript’s text item delimiters to curDelim
  
return aText
end retDelimedText

★Click Here to Open This Script 

Posted in selection | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | Leave a comment

Cocoa Scripting Course Volume #1 NSString v1.1aに更新

Posted on 3月 16, 2021 by Takaaki Naganoya

「Cocoa Scripting Course」シリーズは読者の方からの質問などに従って本文を随時更新していく方式を採用しています。続編で各巻共通部分に変更が加わった場合には既刊分についても共通部分を更新します。

「Cocoa Scripting Course Volume #1 NSString」について、質問により説明不足の箇所が判明したため、追記したり修正したりしています。以下、その修正箇所です。

1章「プログラミングスタイル」>「一部のコマンドで書き換えが必要」「計算の優先順位を示すカッコを修正」を追加。
「添付サンプルScript紹介」>「ディレクトリ構成と概要紹介」を修正。
筆者あとがきの誤字修正。
更新履歴ページを追加。
レイアウトを全体的に修正。
3章「NSString Basic Samples」のヘッダー引用部分の書式変更。
ほか微修正。
Posted in news PRODUCTS | Tagged 10.14savvy 10.15savvy 11.0savvy | Leave a comment

最前面のPDFで連続して同じページが存在するかチェック

Posted on 3月 13, 2021 by Takaaki Naganoya

昨日販売開始した「Cocoa Scripting Course #1」で同じページが連続している箇所をみつけてしまいました。近日中に修正しますが、これを自動でチェックするAppleScriptを書いておく必要性を感じ、作っておきました。

オープンソースのPDFビューワー「Skim」でオープン中のPDFの全ページのテキストを取得し、取得したあとで連続するページのテキスト同士を比較してチェックしています。

必要に応じて各ページを画像にレンダリングして比較する必要があるかと思っていたのですが、テキストだけでもけっこう検出できているのでこんな感じでしょうか。

このページは、AppleScriptにより実際のファイルを検出して表の内容を自動更新していたのですが、その作業バックアップのためにページそのものを複製して誤操作というか作業のやり直しに備えていたのですが、それを削除し忘れたかっこうです。

AppleScript名:最前面のPDFで連続して同じページが存在するかチェック.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/03/13
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

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

script pdfStore
  property aList : {}
end script

set (aList of pdfStore) to {}

tell application "Skim"
  set dCount to count every document
  
if dCount = 0 then return
  
  
tell front document
    set myPath to path
    
set pCount to count every page
  end tell
end tell

set anNSURL to (current application’s |NSURL|’s fileURLWithPath:myPath)
set theDoc to current application’s PDFDocument’s alloc()’s initWithURL:anNSURL

repeat with i from 0 to (pCount – 1)
  set aPage to (theDoc’s pageAtIndex:i)
  
set tmpStr to (aPage’s |string|())
  
set the end of (aList of pdfStore) to (tmpStr as string)
end repeat

set resList to {}
repeat with i from 1 to (pCount – 1)
  set aText1 to contents of item i of (aList of pdfStore)
  
set aText2 to contents of item (i + 1) of (aList of pdfStore)
  
  
if aText1 = aText2 then
    set the end of resList to {i, i + 1}
  end if
end repeat

if resList is equal to {} then
  display notification "PDFに重複ページは見られませんでした。"
else
  set aText to listToText(resList) of me
  
set the clipboard to aText
  
display dialog "重複ページ:" default answer aText with icon 1 buttons {"OK"} default button 1
end if

on listToText(aList)
  set listText to {"{"}
  
set quotChar to ASCII character 34
  
set firstFlag to true
  
  
repeat with i in aList
    set j to contents of i
    
set aClass to class of i
    
if (aClass = integer) or (aClass = number) or (aClass = real) then
      set the end of listText to (getFirst(firstFlag) of me & j as text)
      
set firstFlag to false
    else if (aClass = string) or (aClass = text) or (aClass = Unicode text) then
      set the end of listText to ((getFirst(firstFlag) of me & quotChar & j as text) & quotChar)
      
set firstFlag to false
    else if aClass is list then
      set the end of listText to (getFirst(firstFlag) of me & listToText(j)) –ちょっと再帰処理
      
set firstFlag to false
    end if
  end repeat
  
  
set the end of listText to "}"
  
set listText to listText as text
  
  
return listText
end listToText

on getFirst(aFlag)
  if aFlag = true then return ""
  
if aFlag = false then return ","
end getFirst

★Click Here to Open This Script 

Posted in PDF | Tagged 10.14savvy 10.15savvy 11.0savvy Skim | Leave a comment

Cocoa Scripting Course #1を販売開始

Posted on 3月 12, 2021 by Takaaki Naganoya

Cocoa Scripting本「Cocoa Scripting Course #1 NSString」の販売を開始しました(通称:Cocoa本)。

ページ数:247ページ
フォーマット:PDF+Zipアーカイブ(715ファイル)
特別特典:
Script Debuggerの15%割引購入コード入り
購入後3か月まで、本書の内容で理解できない箇所について3か所まで補足説明
理解度確認テストで合格した方に修了証明書を発行

→ Cocoa Scripting Course #1

→ Cocoa Scripting Course #1 (お試し版)

内容:

macOSのAPIであるCocoaをAppleScriptから利用し、macOSの持つ強力な機能をアプリケーションの補助なしに直接呼び出せる「Cocoa Scripting」は、日々の業務やデータ処理に、たいへん強力な武器になります。

この、Cocoa Scriptingについてはとくに日本語の書籍が存在しておらず、これまでは「Xcodeの使い方、GUIの作り方、各メソッドの使い方….」といった、体系がまったく異なるObjective-Cの入門書で断片的に情報を得ることしかできませんでした。

本書は、Cocoa APIの使い方をAppleScriptに合わせて解説。とくに、Objective-C/Swift入門書にある膨大な「Xcodeの使いこなし」部分は覚える必要はありません。図を中心に説明することで、難解な概念を理解しやすく解説します。

また、本書は「AppleScriptの穴」掲載AppleScriptのカテゴリ別アーカイブ集ともなっており、本書にはNSStringなど文字処理を行うサンプルScriptのファイルを添付しています。

Cocoa Scriptingの日本語による初めての解説本です。文章よりも図などを多めに用いて解説し、添付の大量のScript(715本)を実際に動かして試していただく種類の本です。


▲さっそく、2巻ほか続刊に着手。10巻までは構想があります

eSeminor: Cocoa Scripting Course Volume #1 NSString
eSeminor: Cocoa Scripting Course Volume #2 NSArray
eSeminor: Cocoa Scripting Course Volume #3 NSDictionary
eSeminor: Cocoa Scripting Course Volume #4 NSURL
eSeminor: Cocoa Scripting Course Volume #5 NSImage
eSeminor: Cocoa Scripting Course Volume #6 PDFKit
eSeminor: Cocoa Scripting Course Volume #7 NSAttributedString
eSeminor: Cocoa Scripting Course Volume #8 NSFileManager
eSeminor: Cocoa Scripting Course Volume #9 Webkit
eSeminor: Cocoa Scripting Course Volume #10 System hardware & software Information
▲こちらが構想です。PDFKit本にサードパーティのPDF Framework「PSPDF」に関する言及やサンプルを掲載するという構想もあります。ご意見やご要望は本記事へのコメント欄にお寄せください

Posted in news PRODUCTS | Tagged 10.14savvy 10.15savvy 11.0savvy | 2 Comments

FileMaker選手権2020に3作品応募、3作品入賞

Posted on 3月 12, 2021 by Takaaki Naganoya

Claris FileMaker Proの作品コンテストである「FileMaker選手権2020」に3作品応募し、3作品ともDropbox賞に入賞しました。当て馬とか引き立て役と本命作品が同じ賞ということで……電話で愚痴りまくっていますが気にしないでください。Piyomaru Software関係者だけで5つ賞を取っており、実績としてはなかなかのものです。

目標の金賞・銀賞ではなかったのでたいへんに残念でしたが、Dropboxの年間利用権が3年分チャージされました。もう、AppleScriptからREST API経由で叩きまくるしかありません。サーバーがちぎれるぐらい叩くしか!

作品No.1 Word Color Palette

製作期間3週間。10万例の類義語辞書をFileMaker Proにポーティングして検索キーワードを拡張する「スタークエリー」を実装。色セットと単語の組み合わせを1.4万例収録し、好きな言葉(+拡張された類義語群)で色セットを検索して「おきにいり」に保存。検索した色セットをSVGデータに着色シミュレーションし、Adobe Swatch Exchangeファイルに書き出してIllustratorやPhotoshopですぐに使えるシステムです(応募作品にはASE書き出しモジュールを含んでいません)。
対応プラットフォーム:macOS、Windows、iOS(フル機能はmacOSのみ。macOS 10.15以降推奨)

→ ダウンロード

作品No.2 連ジ判定

製作期間3時間。「戦場の絆」の公式ホームページのMS画像から機械学習モデルを作成。データベース上にドロップされた画像を「連邦軍」「ジオン軍」のどちらの機体かを判定するものです。自転車や自動車など、まったく関係ないメカの写真を喰わせて「お前の自転車ジオン軍」などと遊ぶための他愛もない作品です。
対応プラットフォーム:macOS、iOS

→ ダウンロード

作品No.3 NLP PDF Reader

製作期間半日ぐらい。PDFの本文テキストをCocoaのサービスでメールアドレスやWeb URLなどに分解して、その要素ごとに抜き出してPDF本文の上にオーバーレイ表示・要素ごとに検索できるようにする作品です。また、各ページを画像認識して、認識結果のテキストも展開。「Volcano」で検索すると桜島の写真を見つけられます。
対応プラットフォーム:macOS、iOS

→ ダウンロード
(リンク先のファイルを差し替えました。作成途上のファイルをあげてしまっていたもよう)

これらの渾身の作品を出しても報われなかった、かわいそうな作者への応援のために、Word Color Palette開発時に使いまくった「FileMaker ProをAppleScriptから(Cocoaの機能を呼び出して)動かす」ノウハウについてまとめた、これらの(↓)電子書籍をお買い求めください。

Posted in news | Leave a comment

Keynoteの表の中に入っている1列目のデータをもとにフォルダ検索して値を返す

Posted on 3月 6, 2021 by Takaaki Naganoya

Keynoteの表の中に入っている1列目のデータをもとに、指定ルートフォルダ以下のサブフォルダを指定して、その下位フォルダに存在しているAppleScript書類の数をSpotlightでかぞえ、表の2列目に書き戻すAppleScriptです。

新著「Cocoa Scripting Course #1」の付録Scriptについて、各フォルダに入っているScript書類をかぞえて表に入れておく必要がありました。ただ、内容をアップデートするたびに書き換える必要があるので、自動でカウントして表に書き込むScriptを用意しました。

実行にはShane Stanleyの「Metadata Lib」を必要とします。実行にはScript Debuggerも必要です。Keynoteで表の入ったスライドを表示している必要もあります。表の1列目に書かれたサブフォルダ名を指定して、それぞれ含まれている書類数をカウントして表に書き戻します。


▲初期状態


▲カウント対象フォルダ。AppleScript書類がフラット形式とバンドル形式の2つが混在して入っている


▲書類数をかぞえるルートフォルダを指定。表の1列目にかかれているフォルダ名と連結して、その下をすべてSpotlightで検索してファイルの存在確認を行う


▲すべてカウントして表に書き戻したところ

AppleScript名:表の中に入っている1列目のデータをもとにフォルダ検索して値を返す.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/03/05
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7" — High Sierra (10.13) or later
use framework "Foundation"
use scripting additions
use mdLib : script "Metadata Lib" version "2.0.0"

–カウントするAppleScript書類が入っているフォルダのルートフォルダを指定
set origPath to POSIX path of (choose folder with prompt "Select Target folder")

tell application "Keynote"
  tell front document
    tell current slide
      –現在のスライド上の表を取得
      
set tList to every table
      
      
–表オブジェクトでループ
      
repeat with i in tList
        
        
–表オブジェクトの情報取得
        
tell i
          set colCount to column count
          
set rowCount to row count
          
set headerCount to header row count
          
set footerCount to footer row count
          
          
          
–表のセル内データを取得して2D Arrayにまとめる
          
set newList to {}
          
repeat with y from 1 to rowCount
            tell row y
              set cList to value of every cell
              
set tmpL to {}
              
              
repeat with ii in cList
                set jj to contents of ii
                
if jj = missing value then set jj to "" –空欄はmissing valueが返ってくるのでヌルストリングに差し替え
                
set the end of tmpL to jj
              end repeat
              
              
set the end of newList to tmpL
            end tell
          end repeat
          
          
          
–Keynoteの表データ1列目の情報をもとに、実際のフォルダの中のAppleScript書類を検索してカウントしてlistに記入
          
set new2List to items (headerCount + 1) thru -1 of newList
          
repeat with ii in new2List
            copy ii to oneLine
            
set targFolName to first item of oneLine
            
set tmpTarg to origPath & "/" & targFolName & "/"
            
            
–Spotlight検索でファイルを取得する
            
set aResList to perform search in folders {tmpTarg} predicate string "kMDItemContentType == %@ || kMDItemContentType == %@" search arguments {"com.apple.applescript.script", "com.apple.applescript.script-bundle"} –フラット形式書類とバンドル形式書類を検索
            
            
set scrCount to length of aResList –書類数をカウント
            
set last item of ii to scrCount
          end repeat
          
          
          
–Keynoteの表にデータを書き戻す
          
repeat with y from 1 to (length of new2List)
            tell row (y + 1)
              set aDat to contents of item y of new2List
              
repeat with x from 1 to length of aDat
                
                
–非同期実行モード(倍速処理)
                
ignoring application responses
                  tell cell x
                    set its value to contents of (item x of aDat)
                  end tell
                end ignoring
                
              end repeat
            end tell
          end repeat
          
        end tell
      end repeat
    end tell
  end tell
end tell

★Click Here to Open This Script 

Posted in file list Spotlight | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | 1 Comment

Cocoa Scripting Course #1お試し版を掲載

Posted on 3月 5, 2021 by Takaaki Naganoya

現在作成中の「Cocoa Scripting Course #1」のお試し版を掲載いたしました。どういう内容の本かを手にとってご確認いただけます。完成にはもう少しかかりますが、掲載分についてはだいたい確定した内容によるものです。

→ Cocoa Scripting Course #1を販売開始

また、本書は「AppleScriptの穴」掲載AppleScriptのカテゴリ別アーカイブ集ともなっており、Vol.1にはNSStringなど文字処理を行うサンプルScriptのファイルを添付しています(現時点で636本)。内容の重複などもあり、純粋にこの本数すべてが別々のものになっているわけではありませんが、だいたいこのぐらいです。

すべてを網羅したわけではありませんが、地道に基礎的なサンプルを掲載したのが一番大変だったでしょうか。

Posted in news | Tagged 10.14savvy 10.15savvy 11.0savvy | 1 Comment

Keynoteで全スライドのタイトルアイテムの高さを統一

Posted on 3月 1, 2021 by Takaaki Naganoya

Keynoteの最前面の書類で、選択したマスタースライドに該当するスライドのタイトルのテキストフレームの高さ(height)を統一するAppleScriptです。

Cocoa Scripting本の監修者のedama2さんからタイトルの大きさが不揃いで見にくいという指摘があり、その対処のために組んでみました(泣)。


▲マスタースライド名でどのスライドを処理するか指定


▲スライドタイトルの高さを統一

AppleScript名:全スライドのデフォルトタイトルアイテムの高さを統一.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/03/01
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

set targetHeight to 97

–最前面の書類のベーススライド(マスタースライド)名称一覧を取得してユニーク化
tell application "Keynote"
  set baseNames to (name of base slide of every slide of front document)
end tell
set aRes to uniquify1DList(baseNames) of me

–処理対象のマスタースライドを選択
set tSlide to (choose from list aRes with prompt "処理対象のベーススライド名を選択") as string

–最前面の書類の全スライドのうち、指定のマスタースライドを指定してあるもののタイトルの高さを統一
tell application "Keynote"
  tell front document
    –全スライドを取得してループ
    
set sList to every slide
    
repeat with i in sList
      set j to contents of i
      
tell j
        –スライドのマスタースライド名が指定のものに該当する場合にのみ処理
        
set bSlide to (name of base slide) as string
        
if bSlide is equal to tSlide then
          try
            ignoring application responses
              set height of default title item to targetHeight
            end ignoring
          end try
        end if
      end tell
    end repeat
  end tell
end tell

on uniquify1DList(theList as list)
  set theSet to current application’s NSOrderedSet’s orderedSetWithArray:theList
  
return (theSet’s array()) as list
end uniquify1DList

★Click Here to Open This Script 

Posted in list | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy Keynote | Leave a comment

指定文字のシフトJIS内文字かのチェック

Posted on 2月 28, 2021 by Takaaki Naganoya

指定の文字がシフトJISのコードの範囲に存在しているかどうかをチェックするAppleScriptです。

絵文字とか、日本国内で使われていない(CJK統合漢字のうち日本で使われていない)漢字を除外するために作ってみたものです。もともと、半角文字と全角文字の判定を行うためにNSASCIIStringEncodingに変換できるかどうかを調べるサンプルがあったので、「JIS第1/第2水準文字だけ調べるのに同様の処理で済むのでは?」と考えて試してみたものです。


▲実際のプログラムリスト。プログラムリスト下部のURL Linkをクリックすると、文字列が欠落していないすべての内容がスクリプトエディタ上に転送されます

AppleScript名:指定文字のシフトJIS内文字かのチェック.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/28
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

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

set a1Res to chkSJISChar("微") of me
–> true

set a2Res to chkSJISChar("") of me
–> false

set a3Res to chkSJISChar("熙") of me
–> true

set a4Res to chkSJISChar("") of me
–> false

return {a1Res, a2Res, a3Res, a4Res}
–> {true, false, true, false}

on chkSJISChar(aChar as string)
  set aStr to current application’s NSString’s stringWithString:aChar
  
set tmpStr1 to (aStr’s canBeConvertedToEncoding:(current application’s NSShiftJISStringEncoding))
  
return tmpStr1 as boolean
end chkSJISChar

★Click Here to Open This Script 

Posted in Text | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

私はロボットではありません

Posted on 2月 25, 2021 by Takaaki Naganoya

Web上でクローリングロボットとユーザーが普通にWebブラウズしているのを区別するのに、複数の画像をクリックさせて判定するプログラムが広く利用されています。

AppleScript関連の画像でこれを作るとどうなるのか? と、考えて手短に作ってみたものです。激ムズです。

意外と難しいので、ほとんどの人類がこれをパスできないはずです。

下段、左:Google Apps Script、中央:Classic Mac OSのAppleScript、右:何か別のもの
上段、左:macOS 11.0上のAppleScript書類(たぶんバグ?)、中央:AppleScript書類、右:VBS

Posted in news | Leave a comment

指定した文字で囲まれたキーワードの色を置換する

Posted on 2月 24, 2021 by Takaaki Naganoya

Keynoteで現在オープン中の書類の現在表示中のスライド(ページ)中にあるtext itemのうち、開始文字、終了文字ではさまれているテキストを指定色に塗り替えるAppleScriptです。

用途はご覧の通り、現在作成中のCocoa Scripting本の資料の装飾のためであり、「|」と「|」で囲まれている箇所の色を変えたら見やすいのでは? と、考えて作成・実行したものです。

NSScannerを使えば楽に書けるかも? などと思っておりましたが、検出位置(文字数)を返す機能がないので、位置だけを返してほしいという用途に向いていないもよう。仕方なく、普通にAppleScriptで1文字ごとチェック&開始文字/終了文字のチェックをフラグ管理……という、高級言語らしからぬ泥臭いコードを書く羽目に(でも、こういうの書くケースが多いですよね)。


▲実行前


▲実行後

AppleScript名:指定した文字で囲まれたキーワードの色を置換する
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/24
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

set targCol to choose color –塗る文字色を選択

set headPickUpChar to "|"
set tailPickUpChar to "|"

–処理対象データの取得
tell application "Keynote"
  
  
–最前面の書類
  
tell front document
    
    
–現在表示中のスライド
    
tell current slide
      –text itemをすべて取得
      
set tList to every text item
      
if tList = {} then return –何もtext itemが存在しなかったら処理終了
      
      
–text itemの中に入っている文字列を取得
      
set objTList to object text of every text item
      
    end tell
  end tell
end tell

–出現判定しつつ色を塗る
tell application "Keynote"
  tell front document
    tell current slide
      
      
set posList to {}
      
set aCount to 1
      
      
–text itemでループ
      
repeat with i in objTList
        set j to contents of i
        
        
–ターゲット文字で囲まれている箇所を検出。複数箇所検出対応
        
set bCon to pickUpPositionPairsFromTo(j, headPickUpChar, tailPickUpChar) of me
        
        
if bCon is not equal to {} then
          
          
set aTarg to item aCount of tList
          
          
–出現位置でループ(複数検出対応)
          
repeat with ii in bCon
            copy ii to {aStart, anEnd}
            
            
–高速処理のために非同期実行
            
ignoring application responses
              tell aTarg
                set color of characters aStart thru anEnd of object text to targCol
              end tell
            end ignoring
            
          end repeat
          
        end if
        
        
set aCount to aCount + 1
      end repeat
      
    end tell
  end tell
end tell

–開始文字と終了文字に囲われた文字列のすべての位置情報を返す
on pickUpPositionPairsFromTo(aParamStr, fromStr, toStr)
  script hsAry
    property anArray : {}
    
property aList : {}
  end script
  
  
set (anArray of hsAry) to {}
  
set (aList of hsAry) to characters of aParamStr
  
  
set tmpPair to {}
  
set searchMode to 0 — 0:fromStr, 1:toStr
  
set aCount to 1
  
  
repeat with i in (aList of hsAry)
    set j to contents of i
    
    
if searchMode = 0 then
      if j = fromStr then
        set the end of tmpPair to aCount
        
set searchMode to 1
      end if
      
    else if searchMode = 1 then
      if j = toStr then
        set the end of tmpPair to aCount
        
set searchMode to 0
        
set the end of (anArray of hsAry) to tmpPair
        
set tmpPair to {}
      end if
    end if
    
    
set aCount to aCount + 1
  end repeat
  
  
return (anArray of hsAry)
end pickUpPositionPairsFromTo

★Click Here to Open This Script 

Posted in Color Text | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | 1 Comment

AVFAudioでオーディオ再生のじっけん

Posted on 2月 23, 2021 by Takaaki Naganoya

macOS 11.3で追加されたAVFAudio.frameworkを用いてオーディオ再生を行うAppleScriptです。

実行にはmacOS 11.3以降が必要です。オーディオファイル以外(ムービーなど)を渡すと終了します。

AppleScript名:AVFAudio test 1
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/23
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7" — macOS 11.3 or later
use framework "Foundation"
use framework "AppKit"
use framework "AVFAudio"
use scripting additions

set posixPath to POSIX path of (choose file with prompt "Choose an Audio file:")
set theURL to current application’s |NSURL|’s fileURLWithPath:posixPath
set aPlayer to current application’s AVAudioPlayer’s alloc()’s initWithContentsOfURL:theURL |error|:(missing value)
if aPlayer = missing value then return

aPlayer’s play()
delay 30
aPlayer’s |stop|()

★Click Here to Open This Script 

Posted in Sound | Tagged 11.0savvy | Leave a comment

構成要素を指定して漢字検索 v3

Posted on 2月 22, 2021 by Takaaki Naganoya

旧称「部首で漢字検索」のバージョンアップ版です。部首ではなく構成部品の文字を指定して漢字を検索するAppleScriptです。

便利な道具ではありますが、あくまでも子供の学習用以外の用途にお使いください。

–> Download kanjiSearchFromPartsV3.zip (AppleScript Bundle with library and JSON files in its bundle)

前バージョンでは常用漢字の範囲を超えるデータが出力されるという問題点があったため、常用漢字の一覧データを作成し、これに合致するものだけを出力するようにしました。

常用漢字との照合処理に時間がかかっており、v2ではAppleScriptのネイティブ機能でループして除外チェックを行なっておりました。これをv3ではCocoaの機能を用いて一括で重複部分の抽出を行うことで、v2の半分の時間で完了できることに。v2で0.6秒程度かかっていたものが、v3では0.3秒を下回る時間で処理できるようになりました(MacBook Pro Core i7 2.66GHz)。

そもそも論でいえば、元のJSONデータから常用漢字+人名漢字を超える文字の情報を削除すればいいだけの話なので、JSONデータから常用漢字+人名漢字を超える文字を削除するプログラムを書いて実行するのがよいのでしょう。

AppleScript名:構成要素を指定して漢字検索 v3.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/21
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7"
use framework "Foundation"
use scripting additions
use jkLib : script "jyoyoKanjiLib" –常用漢字一覧を返してくるAppleScriptライブラリ

script jsonStr
  property aJsonDict : missing value –JSONから読み取ったNSDictionary
  
property jKanji : missing value –常用漢字データ(NSArray)
end script

property NSString : a reference to current application’s NSString
property NSCountedSet : a reference to current application’s NSCountedSet
property NSJSONSerialization : a reference to current application’s NSJSONSerialization
property NSUTF8StringEncoding : a reference to current application’s NSUTF8StringEncoding

–図形としての構成要素を指定して漢字検索(部首ではない)
–set aRes to searchKanjiFromElementJ("木") of me –きへん? のぎへんや他のものも返ってくるよ
–> {"椅", "植", "椎", "検", "頼", "漆", "鉢", …}

–set bRes to searchKanjiFromElementJ("氵") of me –さんずい
–> {"滴", "漁", "漂", "漆", "漏", "演", "漠",…}

set dRes to searchKanjiFromElementJ("⻖") of me
–>{"堕", "墜", "阪", "防", "阻", "附", "降"…}

–検索に使える部首のキー文字の一覧を返す
–set qList to listupQueryKeysForKanji() of me
–> {"工", "棘", "左", "位", "婁", "攴", …}

on searchKanjiFromElementJ(aQueryStr)
  if (aJsonDict of jsonStr) = missing value then my init()
  
if (jKanji of jsonStr) = missing value then my initJ()
  
set aRes to (aJsonDict of jsonStr)’s valueForKey:aQueryStr
  
if aRes = missing value then return missing value
  
  
set cArray to aRes’s arrayByAddingObjectsFromArray:(jKanji of jsonStr)
  
set cRes to returnDuplicatesOnly(cArray) of me
  
return cRes
end searchKanjiFromElementJ

on searchKanjiFromElement(aQueryStr)
  if (aJsonDict of jsonStr) = missing value then my init()
  
set aRes to (aJsonDict of jsonStr)’s valueForKey:aQueryStr
  
if aRes = missing value then return missing value
  
return aRes as list
end searchKanjiFromElement

on listupQueryKeysForKanji()
  if (aJsonDict of jsonStr) = missing value then my init()
  
set aRes to (aJsonDict of jsonStr)’s allKeys()
  
return aRes as list
end listupQueryKeysForKanji

on initJ()
  set (jKanji of jsonStr) to current application’s NSArray’s arrayWithArray:(retJyouyouKanji() of jkLib)
end initJ

on init()
  –https://github.com/yagays/kanjivg-radical
  
set aPath to (POSIX path of (path to me)) & "Contents/Resources/element2kanji.json"
  
set jsonString to NSString’s alloc()’s initWithContentsOfFile:(aPath) encoding:(NSUTF8StringEncoding) |error|:(missing value)
  
set jsonData to jsonString’s dataUsingEncoding:(NSUTF8StringEncoding)
  
set (aJsonDict of jsonStr) to NSJSONSerialization’s JSONObjectWithData:jsonData options:0 |error|:(missing value)
end init

on returnDuplicatesOnly(anArray)
  set aSet to NSCountedSet’s alloc()’s initWithArray:anArray
  
set bList to (aSet’s allObjects()) as list
  
  
set dupList to {}
  
repeat with i in bList
    set aRes to (aSet’s countForObject:i)
    
if aRes > 1 then
      set the end of dupList to (contents of i)
    end if
  end repeat
  
  
return dupList
end returnDuplicatesOnly

★Click Here to Open This Script 

Posted in JSON Record | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

部首で漢字検索

Posted on 2月 21, 2021 by Takaaki Naganoya

漢字の部首を指定して、漢字を検索するAppleScriptです。厳密にいえば「部首」の文字ではなく、それっぽい文字で探せます。用途や利用者を想定できれば(子供が勉強用に使わないのであれば)十分に有用だと思います(理由は後述)。

Unicodeのデータから検索できるのではないかと考え、Unicodeの規格を調べていたのですが、漢字のSVGデータから構成文字情報を抽出したとされる「kanjivg-radical」を偶然みつけ、これを利用することで、割と手軽に実現できました。

–> kanjiSearch.zip(Download Script Bundle included JSON in its bundle)

開発環境のMac(Intel Core i7 2.66GHz)で、キャッシュがヒットしていれば(JSONから変換したデータがpropertyに読み込まれていれば)0.02秒程度で検索できています。この手の処理はデータのローディング(読み込み)が命なので、SSD使用必須です。

同データはJSON形式なので、AppleScriptバンドル中にJSONのまま突っ込んで、Cocoaの機能を用いてNSDictionaryに読み込んで検索しています。

ほかにも、Mac OS Xへの移行時に散々紹介されたMac OS Xのビックリドッキリ機能「関連文字に変換」をAppleScriptで実現した「関連文字を検索」も作ってみました。

このあたりをまとめてAppleScriptライブラリにしておけば便利そうですが、まだ使い勝手をテストしている段階です。義務教育で習う漢字の構成要素(へん、つくり etc)の呼び名とkanjivg-radicalで利用できる構成パーツの間に不整合(kanjivg-radicalの方が柔軟)があるので、そのあたりを埋めないと使いにくそう(下手に子供が使うと間違った国語知識を持ってしまう)な危険があるので、そのあたりを補う必要性を感じます。

たとえば、「禾」(のぎへん)を持つ漢字を「木」で検索できてしまうところです。大人は「実用的で使いやすい!」と喜ぶところですが、義務教育課程では両者は厳密に区別されています。自分は使いやすいので喜んで使っていますが、用途によっては使わないほうがよいかもしれません。

追記:

へんやつくりを元に検索できるデータとして、同梱の「radical2kanji_left_right.json」や「radical2kanji_top_bottom.json」が存在していることに気づいたので、そちらをAppleScriptのバンドル中に入れて、同様に検索してみました。

ただ、こちらのデータは随分と粗が多く、「⻖」(こざとへん)で自分の名前に使われている「隆」を「radical2kanji_left_right.json」から検索したところヒットしません。

{"阨", "陵", "隈", "険", "陣", "院", "陲", "陦", "陽", "陳", "陬", "隧", "險", "除", "隍", "陜", "陀", "陏", "隗", "階", "障", "隕", "降", "陂", "隴", "隔", "際", "隅", "附", "限", "陸", "陟", "陌", "阮", "阡", "阯", "阻", "阿", "阪", "防"}

国語辞書や文字コード表との照合といいますか、きちんとした検証作業は行われておらず、機械的に処理しただけのデータという印象を受けます。

一方で、「element2kanji.json」を用いて「⻖」(こざとへん)で検索したところ、

{"嶐", "阨", "蔭", "橢", "薩", "隣", "婀", "陵", "隈", "窿", "険", "隠", "陷", "陣", "痾", "院", "陶", "隙", "陲", "陦", "陽", "陪", "陳", "隘", "陥", "陬", "墜", "隧", "陰", "險", "除", "隍", "陜", "陀", "陛", "陏", "隗", "階", "障", "隕", "降", "陂", "隨", "隴", "隔", "随", "際", "隋", "陞", "隰", "墮", "隱", "陝", "隅", "隊", "附", "限", "陋", "陸", "陟", "隲", "陌", "隆", "阮", "阡", "阯", "阻", "阿", "阪", "堕", "防"}

と、結果が返ってきており……どうも複数のJSONデータを用いて、へんやつくりを考慮したJSONデータで検索して、ヒットしなかったら「element2kanji.json」を用いて物量でダメ押しするように設計されているようです。つまり、「radical2kanji_left_right.json」や「radical2kanji_top_bottom.json」が粗いのを複数のデータで補うように使うものである、と。

無限の量とバリエーションを持つデータに対するアプローチとしては間違っていないと思いますが、文字コードという有限のデータに対しての処理としては少し疑問が残る実装です。本当に使い物になるデータにするには、実際に人間の手による検証と校正が必要な内容でしょう。そのことは明記されるべきです。

「element2kanji.json」は現状のままで有用だと思いますが、「radical2kanji_left_right.json」や「radical2kanji_top_bottom.json」については、実際に国語辞典と照合してデータを補わないと実用レベルにはならないと感じました。盲目的に信用しないで、手元で実際に評価・検証することが重要です。

データ自体、CJK(中国語、日本語、韓国語)の統合漢字をサポートする範囲で作成されているようで、日本語で日常的に利用する常用漢字よりも幅広い文字がデータ化されています。常用漢字の範囲内に含まれているかをチェックするデータを併用するのが妥当でしょう。

AppleScript名:部首で漢字検索.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/21
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7"
use framework "Foundation"
use scripting additions

script jsonStr
  property aJsonDict : missing value
end script

property NSString : a reference to current application’s NSString
property NSJSONSerialization : a reference to current application’s NSJSONSerialization
property NSUTF8StringEncoding : a reference to current application’s NSUTF8StringEncoding

–部首を指定して漢字検索
set aRes to searchKanjiFromElement("木") of me –きへん
–> {"稾", "欅", "謀", "酥", "悚", "椁", "検"….}

–set bRes to searchKanjiFromElement("氵") of me–さんずい
–> {"溯", "湮", "漁", "漕", "濶", "懣", "添", "淨",…..}

–set cRes to searchKanjiFromElement("之") of me
–> {"芝", "泛", "貶", "乏"}

–set dRes to searchKanjiFromElement("⻖") of me
–> {"嶐", "阨", "蔭", "橢", "薩", "隣", "婀"…}

–検索に使える部首のキー文字の一覧を返す
–set qList to listupQueryKeysForKanji() of me
–> {"工", "棘", "左", "位", "婁", "攴", "巨", "攵"…}

on searchKanjiFromElement(aQueryStr)
  if (aJsonDict of jsonStr) = missing value then my init()
  
set aRes to (aJsonDict of jsonStr)’s valueForKey:aQueryStr
  
if aRes = missing value then return missing value
  
return aRes as list
end searchKanjiFromElement

on listupQueryKeysForKanji()
  if (aJsonDict of jsonStr) = missing value then my init()
  
set aRes to (aJsonDict of jsonStr)’s allKeys()
  
return aRes as list
end listupQueryKeysForKanji

on init()
  –https://github.com/yagays/kanjivg-radical
  
set aPath to (POSIX path of (path to me)) & "Contents/Resources/element2kanji.json"
  
set jsonString to NSString’s alloc()’s initWithContentsOfFile:(aPath) encoding:(NSUTF8StringEncoding) |error|:(missing value)
  
set jsonData to jsonString’s dataUsingEncoding:(NSUTF8StringEncoding)
  
set (aJsonDict of jsonStr) to NSJSONSerialization’s JSONObjectWithData:jsonData options:0 |error|:(missing value)
end init

★Click Here to Open This Script 

Posted in File path JSON Record | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy NSJSONSerialization NSString NSUTF8StringEncoding | Leave a comment

ページ範囲処理 v2

Posted on 2月 14, 2021 by Takaaki Naganoya

処理対象ページをユーザーに文字入力させた場合に、

X1,X2,X3,Y-Z

のようなフォーマットを解釈して、処理対象ページ番号をすべて展開するAppleScriptです。

もともと16年前に作成したScriptを書き換えたものです。オリジナルもとくに現行環境で問題なく動いているのですが、ソートルーチンを高速なものに差し替えています。ただし、処理データの量がたいして多くないことを前提としているため(数万ページ指定しないとCocoaのソートルーチンを利用するメリットがない)、Cocoaのソートルーチンは使っていません。

AppleScript名:ページ範囲処理 v2
—
–  Created by: Takaaki Naganoya
–  Created on: 2005/11/04
–  Modified on: 2021/02/14
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.4" — Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set parsedList to parsePageRangeString("1-10, 35, 37, 39, 100-110") of me
–> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 35, 37, 39, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}

–ページ範囲指定のテキスト(多分)を展開して実際のページ数の一覧リストに
on parsePageRangeString(pageText as string)
  set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to ("," as string)
  
set aList to text items of pageText
  
set AppleScript’s text item delimiters to curDelim
  
  
set eList to {}
  
repeat with i in aList
    set j to contents of i
    
if ("-" as string) is in j then
      set eList to eList & parseByHyphen(j) of me
    else
      set the end of eList to j as number
    end if
  end repeat
  
  
set eList to removeDuplicates(eList) of me
  
set eList to shellSortAscending(eList) of me
  
  
return eList
end parsePageRangeString

–重複部分を削除
on removeDuplicates(aList)
  set newList to {}
  
repeat with i from 1 to (length of aList)
    set anItem to item 1 of aList
    
set aList to rest of aList
    
if {anItem} is not in aList then set end of newList to anItem
  end repeat
  
return newList
end removeDuplicates

–ハイフンを実際の数値に変換
on parseByHyphen(aText)
  set aText to aText as string
  
set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to ("-" as string)
  
set aList to text items of aText
  
set AppleScript’s text item delimiters to curDelim
  
  
set sList to {}
  
repeat with i from ((item 1 of aList) as number) to ((item 2 of aList) as number)
    set the end of sList to i
  end repeat
  
return sList
end parseByHyphen

–入れ子ではないリストの昇順ソート
on shellSortAscending(aSortList)
  script oBj
    property list : aSortList
  end script
  
  
set len to count oBj’s list’s items
  
set gap to 1
  
  
repeat while (gap ≤ len)
    set gap to ((gap * 3) + 1)
  end repeat
  
  
repeat while (gap > 0)
    set gap to (gap div 3)
    
if (gap < len) then
      repeat with i from gap to (len – 1)
        set temp to oBj’s list’s item (i + 1)
        
set j to i
        
repeat while ((j ≥ gap) and (oBj’s list’s item (j – gap + 1) > temp))
          set oBj’s list’s item (j + 1) to oBj’s list’s item (j – gap + 1)
          
set j to j – gap
        end repeat
        
set oBj’s list’s item (j + 1) to temp
      end repeat
    end if
  end repeat
  
  
return oBj’s list
end shellSortAscending

★Click Here to Open This Script 

Posted in list Text | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy | Leave a comment

CotEditorの各Windowで選択しておいた内容を座標でソートして結合

Posted on 2月 11, 2021 by Takaaki Naganoya

CotEditorでオープン中の複数のウィンドウから、各ウィンドウ(書類)の選択範囲を取得し、各ウィンドウの画面上の位置情報をもとに、その順番(Y座標、X座標)にテキストを組み合わせて新規書類を作成するAppleScriptです。


▲DEMO


▲Live Coding

当初、ウィンドウの重ね合わせ順(windowのindex)も考慮していたのですが、実際にためしてみたところ、重ね合わせ順を使うのは無駄だったので、機能を外しました。

AppleScript名:CotEditorの各Windowで選択しておいた内容を重ね合わせ順と座標でソートして結合.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/02/10
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

set wList to {}

tell application "CotEditor"
  set wCount to count (every window whose visible is true)
  
if wCount < 2 then return
  
  
repeat with i from 1 to wCount
    tell window i
      set tmpBounds to bounds
      
      
set tmpProp to properties
    end tell
    
    
set tmpDoc to document of tmpProp
    
tell tmpDoc
      set aCon to contents of selection
    end tell
    
    
set tmpX to item 1 of tmpBounds
    
set tmpY to item 2 of tmpBounds
    
set tmpRec to {winIndex:i, winX:tmpX, winY:tmpY, selText:aCon}
    
    
set the end of wList to tmpRec
    
  end repeat
  
end tell

–座標値をもとにソートして選択テキストを返す
set sWList to sortRecListByLabel(wList, {"winY", "winX"}, {true, true}) of me
set anArray to current application’s NSArray’s arrayWithArray:sWList
set vList to (anArray’s valueForKey:"selText") as list
set jointStr to retArrowText(vList, return) of me

–CotEditor上で指定テキストでドキュメントを新規作成
makeNewCotEditorDoc(jointStr) of me

–リストを指定デリミタを追加しつつテキスト化
on retArrowText(aList, aDelim)
  set aText to ""
  
set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to aDelim
  
set aText to aList as text
  
set AppleScript’s text item delimiters to curDelim
  
return aText
end retArrowText

–リストに入れたレコードを、指定の属性ラベルの値でソート
on sortRecListByLabel(aRecList as list, aLabelStr as list, ascendF as list)
  set aArray to current application’s NSArray’s arrayWithArray:aRecList
  
  
set aCount to length of aLabelStr
  
set sortDescArray to current application’s NSMutableArray’s new()
  
repeat with i from 1 to aCount
    set aLabel to (item i of aLabelStr)
    
set aKey to (item i of ascendF)
    
set sortDesc to (current application’s NSSortDescriptor’s alloc()’s initWithKey:aLabel ascending:aKey)
    (
sortDescArray’s addObject:sortDesc)
  end repeat
  
  
return (aArray’s sortedArrayUsingDescriptors:sortDescArray) as list
end sortRecListByLabel

–指定テキストでCotEditorの新規書類を作成
on makeNewCotEditorDoc(aCon)
  tell application "CotEditor"
    activate
    
set newDoc to make new document
    
tell newDoc
      set contents to aCon
    end tell
  end tell
end makeNewCotEditorDoc

★Click Here to Open This Script 

Posted in list Record | Tagged 10.14savvy 10.15savvy 11.0savvy CotEditor | Leave a comment

We released English edition of “FileMaker Pro Scripting Book with AppleScript”

Posted on 2月 9, 2021 by Takaaki Naganoya

Just we released English edition of ebook “FileMaker Pro Scripting Book with AppleScript”.

–> Download Sampler PDF

Title:FileMaker Pro Scripting Book with AppleScript English Edition
Author:Takaaki Naganoya@Piyomaru Software
Technical Supervisor:Masayuki Nii
Price: JPY 3,000 (About USD 30)@our ebook store, JPY 3,500+VAT 10%@PayPal
Delivery: Soon@our ebook store, 1 business day @ paypal (Check and return your URL on cloud storage via email)
Page:158
File format:PDF
Supplement : AppleScript files / RTF exported files / Piyomaru Script Assistant v2 (Japanese Version)

–> Online Store
–> Product Support page





Somebody asked me “Is there English version?” on twitter. I started translation project at that word.

At that point, I thought the translation project wouldn’t be too much hassle.But…it was wrong for me. It took more effort to translate it than write original Japanese version.

Japanese is a strange language. The subject can be omitted.Writing Japanese sentences makes a lot of effort to create a “good atmosphere” rather than facts.

It was very hard work. I added about 20 pages to explain the current status and history of AppleScript itself.

I hope this book will reach a large number of users.

Posted in PRODUCTS | Tagged 10.14savvy 10.15savvy 11.0savvy FileMaker Pro | Leave a comment

最前面のKeynote書類のテキストアイテムの英語化率を求める

Posted on 1月 28, 2021 by Takaaki Naganoya

Keynote書類内のテキストアイテムのうち、どの程度が英語で書かれているかを計算するAppleScriptです。macOS 10.14以降で動作します。

日本語で書いた本を英語に翻訳しているわけですが、進捗を確認するのに自分でページを見ながら確認する作業が地味に大変です。そこで、この大変な作業をAppleScriptで自動処理することにしました。最終的なチェックは目視で行う必要がありますが、翻訳済みのテキストがどの程度あるかをテキストアイテムの個数ベースで(文章の長さは考慮せず)自動計算します。

AppleScriptでKeynote書類中のテキストアイテム中のテキストをすべて取得し、言語を自動判定して英語化率(≒英訳作業の進捗率)を計算してみました。


▲Script Debugger v8で実行したところ。Dark Modeへの対応が嬉しいが、全体的に動作が重い

日本語と英語以外にいろいろ意図しない言語判定されているテキストアイテムが存在していますが、そんな言語は書いていないのでおおよそ英語ブロックでしょう。

いま英語化率は80%と出ていますが、誤判定もあるはずなので、最後の最後は目視判定が必要と思われます。あとは、日本語フォントが指定されている箇所をクリーニングして、英語フォントに指定し直す作業も必要です。

開発マシンでmacOS 10.14.6+Keynote 10.1の環境で、139ページある「FileMaker Pro Scripting Book」の全テキスト判定に3.9秒ほどかかります。速度面でとくに不満はありませんが、こういう処理をM1 Macで行うとどの程度の速度になるのかには興味があります。

FileMaker選手権に応募した作品が入賞すれば、開発マシンの更新も可能かもしれませんが……勝負は時の運ということで。


▲英語への翻訳が完了したページ(表紙)


▲まだ日本語の文章がまだらに残っているページ。ただ、オリジナルの日本語版をもとに日本語の本のルールでページ順を設定しているので、「本当にこれでいいのか?」(奥付が最終ページにある日本スタイルそのまま、とか)とは思っています

AppleScript名:最前面のKeynote書類のテキストアイテムの英語化率を求める.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/01/27
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.7" — High Sierra (10.13) or later
use framework "Foundation"
use framework "NaturalLanguage" –Mojave (10.14) or later
use scripting additions

tell application "Keynote"
  set dCount to count every document
  
if dCount = 0 then
    display notification "There is no Keynote document"
    
return {}
  end if
end tell

set tOut to {}
set erOut to {}

tell application "Keynote"
  tell front document
    set sCount to count every slide
    
repeat with i from 1 to sCount
      tell slide i
        set tList to every text item
        
        
repeat with i in tList
          set aTmpStr to object text of i
          
if aTmpStr is not equal to "" then
            set b1Res to guessLanguageCodeOf(aTmpStr) of me
            
set the end of tOut to b1Res
            
(*
            if b1Res is not equal to "en" then
              set the end of erOut to aTmpStr
            else
              set the end of tOut to b1Res
            end if
            *)

          end if
        end repeat
      end tell
    end repeat
  end tell
end tell

set tPercent to calcOneItemsPercent(tOut, "en") of me

on guessLanguageCodeOf(theString as string)
  set aNL to current application’s NLLanguageRecognizer’s alloc()’s init()
  
aNL’s processString:theString
  
set langRes to (aNL’s dominantLanguage()) as string
  
return langRes
end guessLanguageCodeOf

–true/falseで構成されるlistのうち、指定要素が占める割合を%で計算。小数点以下を四捨五入
on calcOneItemsPercent(aList, targItem)
  set aLen to length of aList
  
set theCountedSet to current application’s NSCountedSet’s alloc()’s initWithArray:aList
  
set tRes to (theCountedSet’s countForObject:targItem)
  
if tRes < 1 then return 0
  
set pRes to (tRes / aLen) * 100
  
return (round pRes rounding as taught in school)
end calcOneItemsPercent

★Click Here to Open This Script 

Posted in Language Text | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | 1 Comment

Keynoteで選択中のテキストアイテムからテキスト取り出し

Posted on 1月 27, 2021 by Takaaki Naganoya

Keynoteで選択中のテキストアイテムからテキスト情報を抽出するAppleScriptです。

# 本内容は当時のKeynote v11.xの状況を反映したもので、その後リリースされたv12ではselectionを取得できるように変更されました

FileMaker Pro Scripting Bookの英語版を来る日も来る日も作っており、気づけばぜんぜんScriptを書いていないので「Piyomaru Software」ではなく「Piyomaru Publishing」だ、などと言っている今日このごろです。Keynoteを毎日使っていますが、微妙に痒いところに手が届かないので、使えば使うほどAppleScriptで機能を補いたくなってきます。

Keynoteに「selected objects」といった「選択中のオブジェクト」を求めるAppleScript用語が用意されていないため、本来やりたい「選択中の部品のデータを処理して元の部品に書き戻す」「選択中の部品からデータを抜き出す」といった処理ができません。selectionで取得できるのが「選択中のスライド」だというのが非常に残念です。

Keynote書類でテキストアイテムを選択し、コピーすると……テキスト情報は取り出せません。Finder上でクリップボード内容を確認してみると、あろうことか「PNGイメージ」と表示されます。

コピーされたクリップボードの内容を解析して、そのオブジェクト情報からテキストを抽出できるとよいだろうか、などとも考えたのですが、

Keynote内部オブジェクトで、ちょっと手強そうです。

というわけで、Keynote側には一切機能がないわけですが、選択中のオブジェクトをコピーし、新規ドキュメントにペーストしたうえで新規ドキュメント上のオブジェクトからテキストを取り出し、新規ドキュメントを破棄することにしました。

GUI Scriptingを用いているので、システム環境設定の「セキュリティとプライバシー」でGUI Scriptingを許可してから実行してください。

AppleScript名:選択中のテキストアイテムからテキスト取り出し.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2021/01/27
—
–  Copyright © 2021 Piyomaru Software, All Rights Reserved
—

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

set kList to getEveryTextFromCurrentKeynoteSlide() of me
set tRes to retDelimedText(kList, return) of me

on getEveryTextFromCurrentKeynoteSlide()
  tell application "Keynote"
    activate
    
    
set dCount to count every document
    
if dCount = 0 then
      display notification "There is no Keynote document"
      
return {}
    end if
    
    
tell front document
      set sCount to count every slide
    end tell
    
if sCount = 0 then
      display notification "There is no Slide in Keynote document"
      
return {}
    end if
    
  end tell
  
  
–Copy
  
tell application "System Events"
    keystroke "c" using {command down}
  end tell
  
  
  
tell application "Keynote"
    activate
    
set nDoc to make new document
    
tell nDoc
      set aMaster to master slide "空白"
      
–set aMaster to master slide "Blank"
      
      
tell current slide
        set base slide to aMaster
      end tell
    end tell
    
  end tell
  
  
–Paste
  
tell application "System Events"
    keystroke "v" using {command down}
  end tell
  
  
delay 0.1 –Important!!
  
  
set tOut to {}
  
tell application "Keynote"
    tell front document
      tell current slide
        set tList to every iWork item
        
        
repeat with i in tList
          set aTmpStr to object text of i
          
set the end of tOut to aTmpStr
        end repeat
      end tell
    end tell
    
    
–Dispose document
    
tell front document
      close without saving
    end tell
  end tell
  
  
return tOut
end getEveryTextFromCurrentKeynoteSlide

on retDelimedText(aList, aDelim)
  set aText to ""
  
set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to aDelim
  
set aText to aList as text
  
set AppleScript’s text item delimiters to curDelim
  
return aText
end retDelimedText

★Click Here to Open This Script 

Posted in GUI Scripting Text | Tagged 10.14savvy 10.15savvy 11.0savvy Keynote | Leave a comment

AppleScript disassembler

Posted on 1月 23, 2021 by Takaaki Naganoya

Twitterで一時期さんざん騒がれていた(一部のアカウントが情報を拡散していた)、AppleScript Disasemblerについて調べてみました。

いわく、

「Macには5年前からウィルス(マイニングツール?)が出回っている。というのも、実行専用のAppleScript appletはAppleのウィルスチェックの対象から外れており、中身を確認できないからである。この脅威に対処するためのツールはXXに問い合わせるとよい。aevt disassemblerなどのツールを用意している」

という内容のものでした。分かりやすい恫喝です。「5年前からウィルスが」云々の是非は知りませんし、それにAppleScriptが使われているのかどうかなども知りません。見たことがないものについては、批評も判断も不可能です。

実行専用のAppleScript AppletだとAppleのチェックを免れる、という点については疑問が残ります。ただ、仮にそうしたものがあったとして、その実行内容をいちいちOS側がチェックしているとも考えにくいので、その可能性は否定できません。

そして、「aevt disassemblerなどのツール」という点、ここが問題です。本当にできるのか? 冗談ツールみたいなもの(特定条件では使えるが実用性がない)はあるのかもしれませんが、そんなに、現代の高度化しているAppleScriptのプログラムの内容を、実行専用バイナリから元ソース取り出しができるものなのか?????? これは、試してみないとなんとも言えません。

えーーー、AppleScriptはAppleEventのバイトコードに翻訳されて実行されます。

この、AppleEventのバイトコードから元のAppleScriptを戻せるかどうかについては、かなり初期から「イベントのコードと実際のAppleScriptの対処表を作れば、元のコードを取り出すことは原理上不可能ではないだろう」という推測が行われてきました。

ただ、その対処表を作るという手間がバカバカしく、苦労の割に得るものが少ないため誰も本気で取り組んでこなかったテーマでもあります。

とりあえず実行専用のAppleScriptでなければ「osadecompile」コマンドがOSに標準装備されているので、これでソースを取得することは可能です。

では、実行専用のAppleScriptやAppletからソースを取得できるのでしょうか?

Github上でそれらしきソフトウェアをみつけました。aevt_decompileとapplescript-disassemblerです。それぞれ実際に試してみました。

確認対象ファイルは、

①普通の(スクリプトエディタで)読める通常形式のAppleScript(.scpt)
②「実行専用」の通常形式のAppleScript(.scpt)
③「実行専用」のAppleScriptアプレット
④「実行専用」のAppleScriptアプレット(コード署名つき)

の4つです。主に、decompilerについて(確認もしないで)騒いでいる連中が槍玉に挙げているのは、③④のはずなので、①②はあくまで比較用です。

aevt_decompile

まず、aevt_decompileを実際にXcode上でビルドし、/usr/local/binにコピーしたうえでTerminal上から実行してみました。

Mac:bin me$ ./aevt_decompile /Users/me/Desktop/copy\ files\ to\ target\ folder.app 
2021-01-23 20:39:21.622 aevt_decompile[10457:2398389] The file “copy files to target folder” couldn’t be opened because you don’t have permission to view it.
Mac:bin me$ ./aevt_decompile /Users/me/Desktop/copy\ files\ to\ target\ folder.app/Contents/Resources/Scripts/main.scpt 
2021-01-23 20:39:55.375 aevt_decompile[10469:2400520] The file “main.scpt” couldn’t be opened using text encoding Unicode (UTF-8).
Mac:bin me$ ./aevt_decompile /Users/me/Desktop/copy\ files\ to\ target\ folder_no_sign.app/Contents/Resources/Scripts/main.scpt 
2021-01-23 20:41:02.693 aevt_decompile[10482:2405472] The file “main.scpt” couldn’t be opened using text encoding Unicode (UTF-8).
Mac:bin me$ ./aevt_decompile /Users/me/Desktop/copy\ files\ to\ target\ folder.scpt 
2021-01-23 20:41:47.007 aevt_decompile[10488:2407982] The file “copy files to target folder.scpt” couldn’t be opened using text encoding Unicode (UTF-8).

結果は、ことごとく「couldn’t be opened」でデスクトップフォルダ上に置いた①〜④のScriptをオープンできませんでした。

applescript-disassembler

Pythonで書かれたこのツールは実行権限を与えるだけで簡単に動きました。また、①〜④のファイルに対してアクセスすることができました。

こちらは結果が出てきました。かなり膨大な内容です。オリジナルのAppleScriptが、

set fileTexts to paragraphs of (the clipboard)

set chkFol to choose folder with prompt "[From] Select Check folder"
set moveTargFol to choose folder with prompt "[To] Select Copy Trget folder"

repeat with i in fileTexts
	set j to contents of i
	set fromPath to (chkFol as string) & j
	try
		tell application "Finder"
			duplicate file fromPath to moveTargFol
		end tell
	end try
end repeat

の程度のひじょうに簡単なものであったのですが、実際に出力されたのは、

# 注:HTMLタグと間違えられてしまう<>については全角記号に置き換えました

--Applet without Code Sign③

Mac:applescript-disassembler-master me$ ./disassembler.py /Users/me/Desktop/copy\ files\ to\ target\ folder_no_sign.app/Contents/Resources/Scripts/main.scpt 
=== data offset 2 ===
Function name : <Value type=object value=<Value type=event_identifier value=b'aevt'-b'oapp'-b'null'-b'\x00\x00\x80\x00'-b'****'-b'\x00\x00\x90\x00'>>
Function arguments:  <empty or unknown>
 00000 PushIt 
 00001 Push0 
 00002 MessageSend 0 # <Value type=object value=<Value type=event_identifier value=b'Jons'-b'gClp'-b'****'-b'\x00\x00\x00\x00'-b'null'-b'\xff\xff\x80\x00'>> 
 00005 PushLiteral 1 # <Value type=object value=<Value type=constant value=0x63706172>> 
 00006 MakeObjectAlias 22 # GetEvery

 00007 GetData 
 00008 PopGlobal b'fileTexts' 
 00009 StoreResult 
 0000a PushIt 
 0000b PushLiteral 3 # <Value type=object value=<Value type=constant value=0x70726d70>> 
 0000c PushLiteral 4 # [<Value type=special value=nil>, <Value type=string value=b'\x00[\x00F\x00r\x00o\x00m\x00]\x00 \x00S\x00e\x00l\x00e\x00c\x00t\x00 \x00C\x00h\x00e\x00c\x00k\x00 \x00f\x00o\x00l\x00d\x00e\x00r'>] 
 0000d Push2 
 0000e MessageSend 5 # <Value type=object value=<Value type=event_identifier value=b'syso'-b'stfl'-b'alis'-b'\x00\x00\x00\x00'-b'null'-b'\xff\xff\x80\x00'>> 
 00011 GetData 
 00012 PopGlobal b'chkFol' 
 00013 StoreResult 
 00014 PushIt 
 00015 PushLiteral 3 # <Value type=object value=<Value type=constant value=0x70726d70>> 
 00016 PushLiteral 7 # [<Value type=special value=nil>, <Value type=string value=b'\x00[\x00T\x00o\x00]\x00 \x00S\x00e\x00l\x00e\x00c\x00t\x00 \x00C\x00o\x00p\x00y\x00 \x00T\x00r\x00g\x00e\x00t\x00 \x00f\x00o\x00l\x00d\x00e\x00r'>] 
 00017 Push2 
 00018 MessageSend 5 # <Value type=object value=<Value type=event_identifier value=b'syso'-b'stfl'-b'alis'-b'\x00\x00\x00\x00'-b'null'-b'\xff\xff\x80\x00'>> 
 0001b GetData 
 0001c PopGlobal b'moveTargFol' 
 0001d StoreResult 
 0001e LinkRepeat 0x64

 00021 PushGlobal b'fileTexts' 
 00022 Dup 
 00023 PushLiteral 9 # <Value type=object value=<Value type=constant value=0x6b6f636c>> 
 00024 PushLiteral 10 # <Value type=object value=<Value type=constant value=0x636f626a>> 
 00025 Push2 
 00026 MessageSend 11 # <Value type=object value=<Value type=event_identifier value=b'core'-b'cnte'-b'****'-b'\x00\x00\x00\x00'-b'****'-b'\x00\x00\x10\x00'>> 
 00029 Push1 
 0002a PushUndefined 
 0002b RepeatInCollection <disassembler not implemented> 
 0002c Equal 
 0002d Equal 
 0002e PushVariable [var_0] 
 0002f PushLiteral 12 # <Value type=object value=<Value type=constant value=0x70636e74>> 
 00030 MakeObjectAlias 21 # GetProperty

 00031 GetData 
 00032 PopGlobal b'j' 
 00033 StoreResult 
 00034 PushGlobal b'chkFol' 
 00035 PushLiteral 14 # <Value type=object value=<Value type=constant value=0x54455854>> 
 00036 Coerce 
 00037 PushGlobal b'j' 
 00038 Concatenate 
 00039 GetData 
 0003a PopGlobal b'fromPath' 
 0003b StoreResult 
 0003c ErrorHandler 87 
     0003f PushLiteralExtended 16 # <Descriptor type=b'alis' content=b'\x00\x00\x00\x00\x014\x00\x02\x00\x01\x06Cherry\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00BD\x00\x01\xff\xff\xff\xff\nFinder.app\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\n cu\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0cCoreServices\x00\x02\x00)/:System:Library:CoreServices:Finder.app/\x00\x00\x0e\x00\x16\x00\n\x00F\x00i\x00n\x00d\x00e\x00r\x00.\x00a\x00p\x00p\x00\x0f\x00\x0e\x00\x06\x00C\x00h\x00e\x00r\x00r\x00y\x00\x12\x00&System/Library/CoreServices/Finder.app\x00\x13\x00\x01/\x00\xff\xff\x00\x00'> 
     00042 Tell 16 
         00045 PushIt 
         00046 PushLiteralExtended 17 # <Value type=object value=<Value type=constant value=0x66696c65>> 
         00049 PushGlobal b'fromPath' 
         0004a MakeObjectAlias 24 # GetIndexed (item A of B)

         0004b PushLiteralExtended 18 # <Value type=object value=<Value type=constant value=0x696e7368>> 
         0004e PushGlobal b'moveTargFol' 
         0004f Push2 
         00050 MessageSend 19 # <Value type=object value=<Value type=event_identifier value=b'core'-b'clon'-b'****'-b'\x00\x00\x00\x00'-b'****'-b'\x00\x00\x90\x00'>> 
         00053 EndTell 
     00054 EndErrorHandler 93 
 00057 HandleError 20 21 
 0005c PushUndefined 
 0005d Dup 
 0005e StoreResult 
 0005f Jump 0x2b 
 00062 Return 

のような、膨大な内容です。まるで、アセンブラのニーモニックを読んでいるかのような感覚です。

10行程度のScriptから14倍の内容が出力されています。一応、一部の処理内容については(エラートラップ部分など)推測することは可能ですが、前半部分はさっぱりです。断片的に変数名などがわかったり、後半のインデント構造的なものが見えたりするあたりはソースのように見えなくもありませんが、この出力から元のAppleScriptの内容を理解できたりするのでしょうか?

もしかすると、Classic Mac OSの開発経験があるとこの内容を「読む」ことが可能なのかもしれませんが、この内容では自分にはさっぱり分かりません。

現状では、AppleEventを人間が読んでも理解できそうな命令語に置き換え、パラメータともども一覧表示しているというものに見えます。そのレベルの機能については間違いなく実現しているでしょう。ただ、そのAppleEventニーモニックの展開ができたからといって、元のAppleScriptのプログラムを復元できるようには見えません。

# じっと眺めていると「スタック操作を頻繁に行っている」ように見えますが、それでもそれ以上の情報は読み取れません

applescript-disassemblerの機能は同梱のドキュメントのとおりで、実行専用のアプレットから元のAppleScriptのプログラムソースが得られるといったものではありませんでした。その動作内容についても確認できましたし、処理レベルも確認できました。

自分が行った検証のかぎりでは(検証前からおぼろげにわかっていましたが)、一部の人間が他の多くのユーザーの警戒心を煽っているような状況では「ない」と思います。おそらく、その解決ツールという名目でそれらしい動作を行うツールを(AppleScriptを読めない顧客に)売りつけ、お金を巻き上げようという魂胆なのでしょう。

Posted in news Security | Tagged 10.14savvy 10.15savvy 11.0savvy | Leave a comment

Post navigation

  • Older posts
  • Newer posts

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

Google Search

Popular posts

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

Tags

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

カテゴリー

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

アーカイブ

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

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

メタ情報

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

Forum Posts

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

メタ情報

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