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

月: 2022年5月

RectangleBinPackを用いて2D Bin Packを解く v2.3

Posted on 5月 31, 2022 by Takaaki Naganoya

オープンソースの「RectangleBinPack」を用いて2D Bin Packagingを解き、Keynote上の汎用オブジェクト(iWork item)を指定矩形内に詰め込むAppleScriptです。

–> Watch Demo Movie

2D Bin Packは、指定のオブジェクトを面積で評価して、ターゲットの領域に「詰め込む」(オブジェクト回転あり)という処理で、ワードクラウドであるとか、記事レイアウト時の最適化配置といった用途に用いられます。

さまざまなアルゴリズムが提唱され、コンピュータの登場初期からどえらい先人たちが攻めまくった分野であるため、ありがたく、その成果をいただいているという用途でもあります。

よく、ゲームのテクスチャ画像を1枚の画像ファイルに詰め込む際に2D Bin Packの処理を用いている例を見かけます。なんでファイルごとに分けないのかはわかりませんけれども(ファイル容量の節約???)。

–> Download Script bundle with RectangleBinPack in its bundle + sample Keynote document

# This AppleScript requires RectangleBinPack executable in its bundle. So, download the whole AppleScript bundle archive from the link above (↑)

オープン中のKeynote書類の表示中のスライド(ページ)上にある矩形オブジェクト(Shape)を指定の矩形エリア内に2D Packingします。エリアの大きさが小さすぎると正常にPackingされなかったり、false(エラー)を返したりします。

変更履歴:

v2.1: BinPackTestをIntel x64とARM binaryのそれぞれのバイナリでビルドしてバンドルに入れた(Makeを書き換えて直接Universalバイナリに仕立てられるといいのに)
v2.2: BridgePlusがなくても動くように書き換えた(ないと動かないのはいろいろ運用上問題がある)
v2.3: shapeに対してBinPackしていたのを、Keynote上の汎用オブジェクトへのアクセス予約語iWork itemでアクセスするように変更した

AppleScript名:rectBinPack v2.3_Universal.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2022/05/31
—
–  Copyright © 2019-2022 Piyomaru Software, All Rights Reserved
—
— 2D Bin Packing by juj https://github.com/juj/RectangleBinPack
— v2.1: BinPackTestをIntel x64とARM binaryのそれぞれのバイナリでビルドしてバンドルに入れた(Universalバイナリに仕立てられるといいのに)
— v2.2: BridgePlusを外した(ないと動かないのはいろいろ運用上問題がある)
— v2.3: shapeに対してBinPackしていたのを、Keynote上の汎用オブジェクトへのアクセス予約語iWork itemでアクセスするように変更した

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

–Packaging Target Area
set binSizeX to 600
set binSizeY to 600

set packRes to packKeynoteObjectsOnCurrentSlide(binSizeX, binSizeY) of me

on packKeynoteObjectsOnCurrentSlide(binSizeX, binSizeY)
  set {tList, a0List} to retRectsFromKeynote() of me
  
  
set aList to sortList2DDecending(a0List, {"myWidth", "myHeight", "myArea"}) of me –Sorting key is Width(main) and Area(sub) and Height(sub)
  
  
set aRes to twoDBinPacking(binSizeX, binSizeY, aList) of me
  
if aRes = false then return false
  
  
tell application "Keynote"
    tell front document
      tell current slide
        repeat with i in aRes
          set {posX, posY} to myPos of i
          
set itemIndex to myID of i
          
set aDeg to myDegree of i
          
          
–sample data {itemCounter:5, myWidth:573, myHeight:52, myArea:29796}
          
set anObjID to itemCounter of (item itemIndex of aList)
          
          
set rotation of iWork item anObjID to aDeg
          
set position of iWork item anObjID to {posX, posY}
        end repeat
      end tell
    end tell
  end tell
  
  
return true
end packKeynoteObjectsOnCurrentSlide

on twoDBinPacking(binSizeX as integer, binSizeY as integer, boxList as list)
  set aParamList to {binSizeX, binSizeY}
  
  
repeat with i in boxList
    –copy i to {tmpID, tmpX, tmpY, tmpArea}
    
— {itemCounter:iCount, myWidth:aWidth, myHeight:aHeight, myArea:anArea}
    
set tmpID to itemCounter of i
    
set tmpX to myWidth of i
    
set tmpY to myHeight of i
    
set tmpArea to myArea of i
    
    
set aParamList to aParamList & tmpX
    
set aParamList to aParamList & tmpY
  end repeat
  
  
set aParam to retDelimitedText(aParamList, " ") of me
  
–> "800 800 340 243 340 73 340 73 155 240 147 125 147 125 147 125 147 125"
  
  
–Parameters for result parsing
  
set s1Str to "Packed to (x,y)=("
  
set s2Str to ")"
  
set s3Str to ","
  
  
set cpuRes to CPU type of (system info)
  
if cpuRes begins with "ARM" then
    set exName to "arm"
  else if cpuRes begins with "Intel" then
    set exName to "x86"
  end if
  
  
set binName to "BinPackTest_" & exName
  
set aPath to POSIX path of (path to resource binName)
  
  
try
    set aRes to do shell script quoted form of aPath & " " & aParam
  on error
    return false
  end try
  
  
if aRes does not end with "Done. All rectangles packed." then return false
  
  
set aList to paragraphs of aRes
  
  
set bList to {}
  
set aCount to 1
  
repeat with i in aList
    set j to contents of i
    
if j begins with "Packing rectangle of size " and j does not contain "Failed!" then
      set xyRes to pickUpFromToStrAndParse(j, s1Str, s2Str, s3Str) of me
      
      
–RectangleBinPackがオブジェクトの回転をサポートしているため、その対処
      
if xyRes is not equal to false then
        set s11Str to "(w,h)=("
        
set s12Str to ")"
        
set s13Str to ","
        
        
set whRes to pickUpFromToStrAndParse(j, s11Str, s12Str, s13Str) of me
        
set tmpBox to item aCount of boxList
        
        
— {itemCounter:5, myWidth:573, myHeight:52, myArea:29796}
        
–copy tmpBox to {tmpID, tmpX, tmpY, tmpArea}
        
set tmpID to itemCounter of tmpBox
        
set tmpX to myWidth of tmpBox
        
set tmpY to myHeight of tmpBox
        
set tmpArea to myArea of tmpBox
        
        
if whRes = {tmpX, tmpY} then
          set aDeg to 0
        else if whRes = {tmpY, tmpX} then
          set aDeg to 90
        else
          return false
        end if
        
        
set the end of bList to {myPos:xyRes, myID:aCount, myDegree:aDeg}
      end if
      
set aCount to aCount + 1
    end if
  end repeat
  
  
return bList
end twoDBinPacking

on pickUpFromToStrAndParse(aStr as string, s1Str as string, s2Str as string, s3Str as string)
  set a1Offset to offset of s1Str in aStr
  
if a1Offset = 0 then return false
  
set bStr to text (a1Offset + (length of s1Str)) thru -1 of aStr
  
  
set a2Offset to offset of s2Str in bStr
  
if a2Offset = 0 then return false
  
  
set cStr to text 1 thru (a2Offset – (length of s2Str)) of bStr
  
set {x, y} to parseByDelim(cStr, s3Str) of me
  
  
return {x as integer, y as integer}
end pickUpFromToStrAndParse

on parseByDelim(aData, aDelim)
  set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to aDelim
  
set dList to text items of aData
  
set AppleScript’s text item delimiters to curDelim
  
return dList
end parseByDelim

–リストを指定デリミタでテキスト化
on retDelimitedText(aList, aNewDelim)
  set aText to ""
  
set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to aNewDelim
  
set aText to aList as text
  
set AppleScript’s text item delimiters to curDelim
  
return aText
end retDelimitedText

on retRectsFromKeynote()
  tell application "Keynote"
    tell front document
      tell current slide
        set tList to every iWork item
        
set bList to {}
        
set iCount to 1
        
        
repeat with i in tList
          set aWidth to width of i
          
set aHeight to height of i
          
set {xPos, yPos} to position of i
          
set anArea to aWidth * aHeight
          
          
set the end of bList to {itemCounter:iCount, myWidth:aWidth, myHeight:aHeight, myArea:anArea}
          
set iCount to iCount + 1
        end repeat
        
        
return {tList, bList}
      end tell
    end tell
  end tell
end retRectsFromKeynote

–入れ子のリストを降順ソート
on sortList2DDecending(a, keyLabelList)
  set fLen to length of keyLabelList
  
set fList to {}
  
  
repeat fLen times
    set the end of fList to false
  end repeat
  
  
return cocoaSortListAscending(a, keyLabelList, fList) of me
end sortList2DDecending

–Cocoaで入れ子のリストをソート true:昇順、false:降順
on cocoaSortListAscending(theList as list, keyLabelList as list, ascendingF as list)
  set anArray to current application’s NSMutableArray’s arrayWithArray:(theList)
  
  
set sortDesc to {}
  
set dLen to length of keyLabelList
  
repeat with i from 1 to dLen
    set tmpKeyLabel to contents of item i of keyLabelList
    
set tmpSortF to contents of item i of ascendingF
    
set theDescriptor to (current application’s NSSortDescriptor’s sortDescriptorWithKey:(tmpKeyLabel) ascending:(tmpSortF))
    
set the end of sortDesc to theDescriptor
  end repeat
  
  
set sortedList to anArray’s sortedArrayUsingDescriptors:(sortDesc)
  
  
return sortedList as list
end cocoaSortListAscending

★Click Here to Open This Script 

(Visited 32 times, 1 visits today)
Posted in 2D Bin Packing list Sort | Tagged 11.0savvy 12.0savvy Keynote | 1 Comment

人類史上初、魔導書の観点から書かれたAppleScript入門書「7つの宝珠」シリーズ開始?!

Posted on 5月 30, 2022 by Takaaki Naganoya

いつものようにコードレス糸電話(FaceTime Audio)で企画会議を行なっていたら、「プログラミングを魔導書の形式で書くことが可能なのではないか?」というアイデアが登場。その場でアイデアスケッチを行い、あれよあれよという間に、実物ができてしまいました。

→ 販売ページ

ノリと勢いだけで作ってしまった1冊ですが、ビジュアル要素多めでまとめられました。ただ、宗教的なアレとかナニとかを完全に無視して作ったものなので、日本国内でしか流通させないほうがよいでしょう。

本書は、プログラミングという魔法について、「魔導書」の観点から記した人類最初の書物である。

難解なプログラミングを、なじみ深い魔導書の観点から説明すると親しみやすくなるのだろうか、という1つの魔術モルモット実験でもある。

本書で扱う内容はごくごく簡単で基礎的な内容だが、このぐらいにしぼって解説すれば難しく見えないという7テーマ、七宝珠である。

「習うより慣れろ」ということわざがあるように、難解な魔術であっても苦手意識を持たずに「慣れる」ことは重要である。 本書をもってしても、真の魔道士を育成することは難しい。だが、「だいたいこんなかんじ」という感覚をつかむためには、このぐらいの分量に抑えることが肝要だろう。

PDF 31ページ

目次

■魔導書「7つの宝珠」

神(Computer)との対話を行う人の子の書
失われし魔法の7つの宝珠を求めて
変数と代入文という最初の宝珠
if文〜条件分岐という宝珠
繰り返しループ 体力を削らせない宝珠
配列変数 詠唱呪文の機能を高める宝珠
コメント文 失われた知恵の宝珠
ログ表示 簡単に変数の中身を確認する宝珠
終了 そこで呪文実行を止める宝珠

■第1の宝珠 変数と代入文

神の言葉から人の子の言葉への移行
巻物で満ち溢れる人の子の世
牛飼いを羊飼いに変える変数
変数に牛や羊を入れるのが「代入」
変数の中に何がある?

■最短詠唱呪文集

魔術入門〜最短詠唱呪文
警告音を鳴らす魔術「beep」
現在の日付を知る魔法「current date」
クリップボードの内容を調べる魔法
時間待ちを行う魔法「delay」
ゆうしゃ(=あなた)のステータス

(Visited 87 times, 2 visits today)
Posted in Books news | Tagged 10.13savvy 10.14savvy 10.15savvy 11.0savvy 12.0savvy | Leave a comment

Keynoteの現在の書類と同じ階層に没スライド入れを作成

Posted on 5月 29, 2022 by Takaaki Naganoya

Keynoteの最前面の書類(現在の書類)と同じ階層に没スライドを入れるゴミ箱用のスライドを、編集中の現在のスライドと同じサイズ(Normal/HD)で同じテーマで作成するAppleScriptです。

ふだん、Keynoteで作業をしているときに、不要になったスライド(ページ)を完全削除せず、別書類に移動させて復活させられるようにしているのですが、その作業が煩雑だったのでScriptで自動化したものです。

同階層にゴミ箱用のスライド書類が存在していたら、それをオープンします。存在していなければ、新規作成して指定ファイル名で保存….というところで、v12のバグに遭遇してしまったわけです。

AppleScript名:Keynoteの現在の書類と同じ階層に没スライド入れを作成.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2022/05/29
—
–  Copyright © 2022 Piyomaru Software, All Rights Reserved
—

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

property newFileName : "没.key" —"trash.key"

tell application "Keynote"
  tell front document
    set dName to getCurThemeName() of me
    
set curFile to (file of it) as alias
    
set myHeight to height of it
    
set myWidth to width of it
  end tell
end tell

–書類の親フォルダを取得(POSIX path)
set parentFol to getParentFol(curFile) of me
set newKeynoteFile to parentFol & "/" & newFileName

–ファイルの存在確認
set exRes to chkFileExistence(newKeynoteFile) of me
if exRes = true then
  –すでに存在している場合はそれをオープン
  
set newKeynoteFileAlias to (POSIX file newKeynoteFile) as alias
  
tell application "Keynote"
    open newKeynoteFileAlias
  end tell
  
return
else
  –まだ存在していない場合、最前面の書類と同じテーマ、縦横比(SD、HD)の新規書類を作成する
  
set parentFolAlias to (POSIX file parentFol) as alias as string –POSIX path to HFS path string
  
set saveFilePathStr to (parentFolAlias as string) & newFileName
  
  
tell application "Keynote"
    set newDoc to make new document with properties {document theme:theme dName, width:myWidth, height:myHeight}
    
–save newDoc in file saveFilePathStr as Keynote–Keynote v12のバグに遭遇したため機能オフに
  end tell
end if

–ファイルの存在確認
on chkFileExistence(aFilePathStr)
  set fileManager to current application’s NSFileManager’s defaultManager()
  
set aRes to fileManager’s fileExistsAtPath:aFilePathStr
  
return aRes as boolean
end chkFileExistence

on getParentFol(anAlias)
  set aPath to POSIX path of anAlias
  
set pathString to current application’s NSString’s stringWithString:aPath
  
set newPath to pathString’s stringByDeletingLastPathComponent()
  
return newPath as string
end getParentFol

on getCurThemeName()
  tell application "Keynote"
    set dCount to count every document
    
if dCount = 0 then error "No Document"
    
    
tell front document
      set aTheme to document theme
      
set atThemeName to name of aTheme
    end tell
  end tell
end getCurThemeName

★Click Here to Open This Script 

(Visited 32 times, 1 visits today)
Posted in File path | Tagged 10.15savvy 11.0savvy 12.0savvy Keynote | Leave a comment

Keynoteで選択中のスライドのすべての表のセル内文字色を黒にする

Posted on 5月 27, 2022 by Takaaki Naganoya

Keynote v12.0以降で、最前面の書類で選択中のスライド(複数可)にある表のすべての文字色を「黒」に変更するAppleScriptです。

–> Watch Demo Movie

Keynote v12.0で「selection」がまともに機能するようになったので、Keynote用Scriptの実用性がたいへんに高まっています。

# ファイル保存できないとかいうバグが一刻も早く治ることを希望しています。とくに、Pages!

もともと、複数ページにわたって掲載している「表」の中に赤字でマークした箇所があって、そのマークの意図とは別の赤字を入れたかったので、いったんすべて書式をリセットしたかったので書いたものです。

もうちょっと長いScriptを書かなければならないかと思っていたのですが、ことのほかシンプルに書けました。
もっとシンプルに書けるか(everyを使ってスライドごと指定するとか)も試してみたのですが、どうやらこのあたりが限界のようです。

Keynoteのselectionを活かしたScriptでいまいちばん活躍しているのは、Keynoteのテキストアイテム(text item)から内容を取得して、メモリ上でAppleScriptとしてコンパイルし、構文色分けを反映させたスタイル付きテキストを取得して、テキストアイテムに書式を反映させるものです。実に、Keynote上にテキストで書いておいたAppleScriptのリストを構文色分けを反映させた掲載リストに変換できるので便利です。

AppleScript名:Keynoteで選択中のスライドのすべての表のセル内文字色を黒にする.scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2022/05/27
—
–  Copyright © 2022 Piyomaru Software, All Rights Reserved
—

tell application "Keynote"
  set aVer to version
  
  
considering numeric strings
    if aVer < 12.0 then return –Keynote v12.0より以前のバージョンでは実行できない
  end considering
  
  
tell front document
    set aaSel to selection
    
set selClass to class of contents of first item of aaSel
    
if selClass is not equal to slide then return –選択中のオブジェクトがslide(ページ)でなければ処理終了
    
    
repeat with i in aaSel
      set j to contents of i
      
      
tell j
        –現在のスライド上のすべての表のすべてのセルの文字色を黒 {0, 0, 0}に
        
set text color of every cell of every table to {0, 0, 0}
      end tell
      
    end repeat
    
  end tell
  
end tell

★Click Here to Open This Script 

(Visited 40 times, 1 visits today)
Posted in list Object control | Tagged 10.15savvy 11.0savvy 12.0savvy Keynote | Leave a comment

新発売:AppleScript基礎テクニック集(12)Unix shell commandの利用

Posted on 5月 26, 2022 by Takaaki Naganoya

電子書籍の新刊を発売しました。新シリーズ「AppleScript基礎テクニック集」の第12巻、「Unix shell commandの利用」です。PDF 34ページ、サンプルAppleScriptのZipアーカイブを添付。

→ 販売ページ

Unix shell commandの利用といったときに、「AppleScriptからdo shell scriptコマンドでshell commandを呼び出す」話と、「shell commandやshell scriptの中でAppleScriptで書いたプログラムを呼び出す」という、まったく価値観の異なる別の話が含まれています。

本書は、これらのまったく別な話に含まれている概念やノウハウを整理し、わかりやすく具体的にその方法や制限についてご紹介する本です。

目次

■Terminal環境とdo shell script環境の違い

shell scriptをAppleScriptと組み合わせるために
ターミナルに書類のパスを入力する方法
Terminalからプロセスの確認と終了を
Terminalとdo shell sciptの環境変数
Terminal.appをAppleScriptで操作できる①
Terminal.appをAppleScriptで操作できる②

AppleScriptからshell scriptを呼び出す

do shell scriptコマンド
パス形式変換
Terminal.app上と同じ環境変数を使用するには
参考資料:新規インストールしたユーザーの環境変数
パラメータの与え方について
do shell scriptコマンドちょっといいノウハウ
コマンドライン呼び出しプログラムをScriptに同梱

shell scriptからAppleScriptを呼び出す

AppleScript関連のshell command
shell scriptからAppleScriptを呼び出す方法①
shell scriptからAppleScriptを呼び出す方法②
パラメータ指定できるAppleScriptの書き方
AppleScriptライブラリを呼び出せる?
パイプで指定した内容を受信できる?
GUI Scriptingを利用できる?
ホームディレクトリ下のFrameworkを呼べる?

(Visited 39 times, 1 visits today)
Posted in Books news | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy | Leave a comment

Pages v12に謎のバグ。書類上に11枚しか画像を配置できない→解決

Posted on 5月 23, 2022 by Takaaki Naganoya

Pages v12に謎のバグを見つけました。Pagesでは書類上に任意の画像を配置できるわけですが、11枚目までは配置できるものの、12枚目を配置できません。実際には120枚ほど画像を用意してテストしていたので、12枚目が配置できればそれでOKかと言われれば、ぜんぜん不十分です。

→ OSの再起動を含む、追試を何回か行ってみたところ、その後このままでは画像の貼り込みができなくなっていました。そして、画像ファイル貼り込み前にパスの文字列をaliasにcastしたところ、問題なく120枚貼り込めました。

–> Watch Movie

以前にも、Keynoteに「特定サイズ以上の表を作るとエラーになる」とかいったバグが発生していましたが、この12個目を配置するとエラーになるというのも、内部で何か不可思議なリミッターを設けているように見えます。

スクリプトエディタ、Script Debuggerの両方で発生しています。おそらく、ランタイム環境が何であるかはこの問題に影響を与えていません。

macOS 10.12以降で、日本語環境限定で発生しているバグで有名なものに、「日本語入力Input Method経由でファイル名を入力している最中に、不必要な不可視文字が入力されてしまい、これがファイル処理を妨げる危険性がある」というものがありますが、これらの画像のファイル名をチェックしたところ、そうした危険な不可視文字は混入していませんでした。

# こうした、複数チームの担当製品の間で発生しているバグは、どこが担当してバグを調査するということはないようです。組織の細分化にともない、こうした組織境界面でバグが発生するととたんに無責任になるのがいまのAppleです(組織の構造上の問題です)

ちなみに、GUI経由で画像をPages書類上に配置してみたところ、12枚以上配置できました。Pagesにそのような上限が存在しているわけではないようです。

Pages書類(バンドル書類)内で何かファイル名の重複のようなものが発生したのかと考え、別の画像を(番号をずらして)指定してみましたが、同様の枚数を配置した時点でエラーになりました。

内部で発生している(していた)別のエラーを発生させないように、謎のリミッターをかけていた可能性もありますが、その必然性がよくわかりません。

AppleScript名:指定の画像をPagesに順次貼り込む(12枚で止まってしまう!).scpt
set baseName to "book24_"
set baseFol to (choose folder) as string

set pMax to 10

(*
tell application "Pages"
  –set newDoc to make new document
  
  tell front document
    set dCount to count every page
    
    repeat with i from (dCount + 1) to pMax
      make new page
    end repeat
    
    set newDCount to count every page
  end tell
end tell
*)

repeat with i from 1 to 120
  set aFN to baseFol & baseName & makeFN(i, 4) of me & ".jpg"
  
tell application "Pages"
    tell front document
      tell page i
        set newItem to make new image with properties {file:aFN}
        
tell newItem
          set position of it to {0, 0}
          
set height of it to 843
          
–set position of it to {-1, 0}
          
set locked to true
        end tell
      end tell
    end tell
  end tell
end repeat

on makeFN(aNum, aDigit)
  set aText to "00000000000" & (aNum as text)
  
set aLen to length of aText
  
set aRes to text (aLen – aDigit + 1) thru -1 of aText
  
return aRes
end makeFN

★Click Here to Open This Script 

(Visited 79 times, 1 visits today)
Posted in Bug news | Tagged 10.15savvy 11.0savvy 12.0savvy Pages | Leave a comment

iWorkアプリケーションv12に共通のバグ? 新規ファイルの保存ができない

Posted on 5月 23, 2022 by Takaaki Naganoya

Apple iWorkアプリケーション(Keynote、Pages、Numbers)の最新バージョンv12.0において、共通のバグがあるのではないか? と見ています。もちろん、見ているだけでなくAppleにバグレポートもしています。

症状は、新規作成した書類を「保存できない」というものです。

以前にも、PDFをexportできないという致命的なバグが発生していましたが、今回のも同様のメカニズムで発生しているものと見ています。つまり、「Appleが自社OSに設定したセキュリティ機能によって、自社アプリであるKeynote、Pages、Numbersが自家中毒を起こしている」という状態です。

自分の勘違いだとよいのですが….

あとは、Numbersのsaveコマンドをよく見てみると、書類フォーマットに「as Numbers」というenumがあるのですが、これはAppleScriptの処理系では「number」の複数形として認識されてしまうので、この予約語自体に無理があります。ここは、「as Numbers format」といった予約語に変えるべきです。

AppleScript名:Keynoteで新規書類作成して指定名称で新規保存.scpt
set dtPath to (path to documents folder) as string
set uuidStr to (do shell script "uuidgen") & ".key"
set savePath to dtPath & uuidStr

tell application "Keynote"
  set nDoc to make new document with properties {document theme:theme id "Application/21_BasicWhite/Standard", width:1024, height:768}
  
save nDoc in file savePath as Keynote
end tell

★Click Here to Open This Script 

AppleScript名:Pagesで新規書類を作成して指定名称で新規保存.scpt
set dtPath to (path to documents folder) as string
set uuidStr to (do shell script "uuidgen") & ".pages"
set savePath to dtPath & uuidStr

tell application "Pages"
  set nDoc to make new document with properties {document template:template id "Application/Blank/ISO"}
  
save nDoc in file savePath as Pages Format
end tell

★Click Here to Open This Script 

AppleScript名:Numbersで新規書類作成して指定名称で新規保存.scpt
set dtPath to (path to documents folder) as string
set uuidStr to (do shell script "uuidgen") & ".numbers"
set savePath to dtPath & uuidStr

tell application "Numbers"
  set nDoc to make new document
  
save nDoc in file savePath as numbers –change "Numbers" word into "numbers format" because "numbers" is alredy registered as "list of number" or "every number"
end tell

★Click Here to Open This Script 

(Visited 61 times, 1 visits today)
Posted in Bug news | Tagged 10.15savvy 11.0savvy 12.0savvy Keynote Numbers Pages | Leave a comment

新発売:AppleScript基礎テクニック集(11)AppleScriptアプレットとドロップレット

Posted on 5月 20, 2022 by Takaaki Naganoya

電子書籍の新刊を発売しました。新シリーズ「AppleScript基礎テクニック集」の第11巻、「AppleScriptアプレットとドロップレット」です。PDF 41ページ、サンプルAppleScriptのZipアーカイブを添付。

→ 販売ページ

本シリーズも、着手した頃には「そんなに細切れのテーマで書けるのか?」「そんな作り方で作れるはずがない」といった意見が集まっていたものですが(チーム内の打ち合わせ時には割と批判的です)、実際に作り出したらトンでもなく「書くべきこと」があって、書けば書くほど新たなテーマが見つかるという恐るべき状態。

今回の「アプレット」「ドロップレット」については、あまり振り返ったことがなかったのですが、いざ書いてみると尋常でないほどの情報が溜まっていました。

スクリプトエディタとScript Debuggerという2つの開発環境のちがい、アプレット、ドロップレット、Cocoa-AppleScriptアプレット、Script Debuggerの拡張ドロップレットなどなど。常駐タイプのアプレットに、タイマー割り込み処理のアプレット。アプレットのアイコンのカスタマイズに、アプレット内にAppleScriptライブラリを同梱する方法、Cocoa Frameworkを入れて呼び出す方法など、盛りだくさんな内容をお送りしています。

目次

■アプレット

AppleScriptをアプリケーション形式で書き出し
AppleScriptアプレットの種類
AppleScriptアプレットの作成方法
AppleScriptアプレットのオプション指定
常駐型AppleScriptアプレットの作成方法
常駐型AppleScriptアプレットの記述
アプレットの「初期画面」を指定
「初期画面」に画像をペーストした場合の動作
アプレット/ドロップレットのユーザーインタフェース
資料:スクリプト/アプレットのバンドル構造
資料:アプレットのカスタマイズ①
資料:アプレットのカスタマイズ②
資料:アプレットのカスタマイズ③

■Cocoa-AppleScriptアプレット

Cocoa-AppleScriptアプレットの作成方法
参考資料:Delegateスクリプトの内容確認方法
参考資料:Delegateスクリプトのヘッダー内容
参考資料:Delegateスクリプトのハンドラ

■Script Debuggerのアプレット/拡張アプレット

AppleScriptアプレット(SD)の作成方法
AppleScript拡張アプレット(SD)の作成方法
AppleScript拡張アプレット(SD)の作成方法

■ドロップレット

AppleScriptドロップレットの作成方法
AppleScriptドロップレットの作成方法
ドロップレットによるファイルの受信
macOS 10.12以降の問題への対策ドロップレット
macOS 12.4上でドロップレット処理を実験

(Visited 69 times, 1 visits today)
Posted in Books news | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy | Leave a comment

Keynoteで選択中のGroup内オブジェクトを座標でソートし、テキスト抜き出し

Posted on 5月 15, 2022 by Takaaki Naganoya

Keynote v12.0以降でオープン中の最前面の書類の、表示中のスライド(ページ)上で選択中のグループから、その内部に収められているオブジェクトからテキストを取り出し、リスト(配列)にまとめるAppleScriptです。


▲書類上のオブジェクト(グループ)を選択した状態


▲1冊分のデータがグループにまとめられており、グループ内にオブジェクトを格納

いったんデータを組み上げた「書類」からデータを抜き出すのは、AppleScriptの重要な仕事です。各データ内のフィールドについて座標情報から自動判別するようにしていますが、座標値が想定どおりになっていない場合もあるため、これでもまだ不十分なので、相対的な位置関係(左上、右上、下 などといった)を定義してデータを取り出すようにするとよいでしょう。

……そこまで高度なものを作らなくても、文字列の長さに着目してソートしたら瞬殺でした。

AppleScript名:選択中のGroup内オブジェクトを座標でソートし、テキスト抜き出し.scpt
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property NSFont : a reference to current application’s NSFont
property NSColor : a reference to current application’s NSColor
property NSFontAttributeName : a reference to current application’s NSFontAttributeName
property NSMutableAttributedString : a reference to current application’s NSMutableAttributedString
property NSForegroundColorAttributeName : a reference to current application’s NSForegroundColorAttributeName

script spd
  property allList : {}
  
property aaSel : {}
end script

set (allList of spd) to {}

tell application "Keynote"
  set aVer to version
  
if aVer < "12.0" then return
  
  
set acceptClass to {text item, shape}
  
  
tell front document
    set (aaSel of spd) to selection –need Keynote v12.0 or later
    
    
repeat with i in (aaSel of spd)
      set j to contents of i
      
set aClass to class of j
      
      
if aClass = group then
        tell j
          set gItemList to every iWork item
        end tell
        
        
set posList to {}
        
set aCount to 1
        
        
repeat with ii in gItemList
          set jj to contents of ii
          
set bClass to class of jj
          
          
if bClass is in acceptClass then
            tell jj
              set {posX, posY} to position
              
              
try
                set tmpStr to object text as string
              on error
                set tmpStr to ""
              end try
            end tell
            
            
set the end of posList to {positionX:posX, positionY:posY, objID:aCount, myStr:tmpStr}
          end if
          
          
set aCount to aCount + 1
        end repeat
        
        
–座標データをもとにソート
        
set sortedList to sortRecListByLabel(posList, {"positionY", "positionX"}, {true, true}) of me
        
        
–1グループ分のテキストを組み立てる
        
set tmpList to {}
        
repeat with ii in sortedList
          set jj to contents of ii
          
set aStr to myStr of jj
          
set the end of tmpList to aStr
        end repeat
        
set the end of (allList of spd) to tmpList
      end if
    end repeat
  end tell
end tell

return (allList of spd)
–> {{"変数名", "❺", "意外と苦労している人が多い、変数やプロパティ名の命名ルール。とくに、予約語と衝突しない名前について"}, {"条件分岐", "❼", "条件分岐はプログラムに必須。自転車でいえば、カーブで曲がれないとか、水たまりを避けられないぐらい困ります。"}, {"用語辞書", "❹", "読めないと書けない、でも、あの人もこの人も読めない用語辞書。自由自在に読めれば、自由自在に書ける!"}, {"ループ処理", "➓", "プログラムをシンプルに書くための一番大事な構文。書き方によって速度が違ったり、高度な処理を簡潔に書ける!"}, {"アプレット", "⓫", "AppleScriptをアプリケーションとして書き出す、簡易アプリケーション「アプレット」の最新動向!"}, {"間接指定", "❶", "対象としたデータだけでなく、幅広いデータに対応できるよう、プログラムに柔軟性を与える間接指定"}, {"ダイアログ表示", "❾", "簡単に行えるメッセージ表示手段。外部ライブラリの利用でさらなる高機能ダイアログを紹介。"}, {"環境整備", "❽", "macOSに標準で入っているツールを呼び出しやすくしたり設定したりする程度。全体像を掴んでレッツ環境整備。"}, {"フィルタ参照", "❻", "AppleScript独特の概念で、「膨大なデータから正規表現で絞り込む」などの他の処理系と異なる、基礎にして奥義"}, {"tellブロック", "❷", "AppleScriptの7割以上を占める、tellブロックの記述や整理方法を楽に書く秘訣のかずかず"}, {"❸", "ファイルパス", "まさに「基礎」中の「基礎」。「できて当たり前」といえるパス操作。知っているだけで差がつく基礎"}}

–リストに入れたレコードを、指定の属性ラベルの値でソート
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

★Click Here to Open This Script 

(Visited 38 times, 1 visits today)
Posted in list Sort | Tagged 12.0savvy Keynote | Leave a comment

新発売:AppleScript基礎テクニック集(10)ループ処理

Posted on 5月 13, 2022 by Takaaki Naganoya

電子書籍の新刊を発売しました。新シリーズ「AppleScript基礎テクニック集」の第10巻、「ループ処理」です。PDF 33ページ、サンプルAppleScriptのZipアーカイブを添付。

→ 販売ページ

ループ処理について、さまざまなrepeat文のバリエーションをまんべんなくすべて知って理解するよりも「間違いなく必要な場所で使える」ことが重要です。

repeat文にもいくつか書き方はあるものの、おおよそ2パターンぐらいでだいたい足ります。

それでも、複数の配列を同時にループしなくてはならないとか、ステップ値を想定の値に合わせるための調整とか、ノウハウらしきものはいろいろあります。

また、参照値をそのまま使うとエラーになる例もあるため、「contents of」でオブジェクトを取り出す必要があるといったささいなノウハウが必要なものでもあります。

目次

■ループによる繰り返し処理

AppleScriptの制御構文
繰り返しループ
repeat文①
repeat文②
repeat文③
repeat文④
repeat文⑤
repeat文⑥
exit repeat
多重ループ+exit repeat

■アプリケーションから取得したオブジェクトでループ

アプリケーションのオブジェクトを処理
Photos上の選択中の写真から情報を取得
Keynoteで選択中のオブジェクトを位置でソート
Numbersで表のセルが連結されていたら分離
targetが重複しているFinder Windowをクローズする
ミュージック.appで選択中のtrackの情報取得
大量のオブジェクト受信に備える

■高度な処理を簡潔に記述

複数の配列の同時ループ
ページ分け
再帰処理

(Visited 39 times, 1 visits today)
Posted in Books news | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy | Leave a comment

Safariで表示中のYouTubeムービーのサムネイル画像を取得

Posted on 5月 9, 2022 by Takaaki Naganoya

Safariで表示中のYouTubeムービーのサムネール画像を取得、保存、表示するAppleScriptです。

YouTubeのムービーのサムネール画像の取得方法を確認し、動作確認用にダイアログ表示+画像保存の機能を追加したものです。Script Debugger上で動かしている分には、NSImageの内容を結果表示ビューワで自動表示されますが、ない人向けに付けた機能です。

画像自体は、「ピクチャ」フォルダにUUIDつきでPNG形式で保存します。

–> Download Script bundle with Library

掲載リストには、画像表示ライブラリが含まれていないため、そのままでは実行できません。上記のScript Bundleをダウンロードして実行する必要があります。

AppleScript名:Safariで表示中のYouTubeムービーのサムネイル画像を取得.scptd
—
–  Created by: Takaaki Naganoya
–  Created on: 2022/05/09
—
–  Copyright © 2022 Piyomaru Software, All Rights Reserved
—

use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"
use imgLib : script "imageDisplayLib"

property NSUUID : a reference to current application’s NSUUID
property |NSURL| : a reference to current application’s |NSURL|
property NSString : a reference to current application’s NSString
property NSImage : a reference to current application’s NSImage
property NSPNGFileType : a reference to current application’s NSPNGFileType
property NSURLComponents : a reference to current application’s NSURLComponents
property NSBitmapImageRep : a reference to current application’s NSBitmapImageRep
property NSMutableDictionary : a reference to current application’s NSMutableDictionary

tell application "Safari"
  tell front document
    try
      set aURL to URL
    on error
      set aURL to "https://www.youtube.com/watch?v=_fmDtIV9vvI"
    end try
  end tell
end tell

if aURL does not start with "https://www.youtube.com/watch?" then return

set urlDict to parseURLParamsAsDict(aURL) of me
set aParam to urlDict’s valueForKey:"v"
if aParam = missing value then return

set imgURL to "https://i1.ytimg.com/vi/" & (aParam as string) & "/mqdefault.jpg"
set newURL to |NSURL|’s URLWithString:imgURL
set aImg to NSImage’s alloc()’s initWithContentsOfURL:newURL

set imgPath to (POSIX path of (path to pictures folder) & ((aParam as string) & "_") & (NSUUID’s UUID()’s UUIDString()) as string) & ".png"

–Save
saveNSImageAtPathAsPNG(aImg, imgPath) of me

–Display
dispImage(aImg, "YouTube thumbnail") of imgLib

on parseURLParamsAsDict(aURL)
  set components to NSURLComponents’s alloc()’s initWithString:aURL
  
set qList to (components’s query())’s componentsSeparatedByString:"&"
  
  
set paramRec to NSMutableDictionary’s dictionary()
  
  
repeat with i in qList
    set keyAndValues to (i’s componentsSeparatedByString:"=")
    (
paramRec’s setObject:(keyAndValues’s objectAtIndex:1) forKey:(keyAndValues’s objectAtIndex:0))
  end repeat
  
  
return paramRec
end parseURLParamsAsDict

–NSImageを指定パスにPNG形式で保存
on saveNSImageAtPathAsPNG(anImage, outPath)
  set imageRep to anImage’s TIFFRepresentation()
  
set aRawimg to NSBitmapImageRep’s imageRepWithData:imageRep
  
  
set pathString to NSString’s stringWithString:outPath
  
set newPath to pathString’s stringByExpandingTildeInPath()
  
  
set myNewImageData to (aRawimg’s representationUsingType:(NSPNGFileType) |properties|:(missing value))
  
set aRes to (myNewImageData’s writeToFile:newPath atomically:true) as boolean
  
  
return aRes –成功ならtrue、失敗ならfalseが返る
end saveNSImageAtPathAsPNG

★Click Here to Open This Script 

(Visited 98 times, 1 visits today)
Posted in Image Record Text URL | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy Safari | Leave a comment

新発売:AppleScript基礎テクニック集(9)ダイアログ表示

Posted on 5月 6, 2022 by Takaaki Naganoya

電子書籍の新刊を発売しました。新シリーズ「AppleScript基礎テクニック集」の第9巻、「ダイアログ表示」です。PDF 43ページ、サンプルScript、AppleScriptライブラリのZipアーカイブを添付。

→ 販売ページ

ダイアログ表示については、たいへん基礎的な内容でありながらも数多くの機能が盛り込まれています。サードパーティ側でさまざまなダイアログを作れるようになってきて、「みんなが思っているよりも、けっこう便利」な環境ができています。

利用するかしないかは、皆様の判断によると思いますが、実際に利用した方は割と便利で手放せなくなるようです。

目次

ダイアログ表示

標準搭載のさまざまなダイアログ表示機能
メッセージ表示系ダイアログ
メッセージ表示系ダイアログ
ファイル選択ダイアログ
フォルダ選択ダイアログ
ファイル名選択ダイアログ
多項目選択系ダイアログ
色選択ダイアログ
LAN内のリモート資源の選択
ローカルのアプリケーションの選択
リモート・アプリケーションの選択

AppleScriptライブラリを利用したダイアログ表示

AppleScriptライブラリの用語辞書の確認方法
筆者のライブラリにはサンプルScript掲載
iPhoneやiPad、MacとAirDrop通信
チェックボックス選択ダイアログを表示
日付選択ダイアログを表示
場所選択ダイアログを表示
複数ポップアップ選択ダイアログを表示
指定のRTF書類から抽出した書式を選択するダイアログ
指定の場所を異なる拡大倍率で地図表示
表形式のデータをダイアログ表示
ラベルつきテキストフィールドを表示/データ修正
指定色の一覧選択ポップアップメニューを表示
Scriptでカスタマイズ可能な複雑なダイアログ

(Visited 37 times, 1 visits today)
Posted in Books news | Tagged 10.14savvy 10.15savvy 11.0savvy 12.0savvy | Leave a comment

Keynoteのタイトル内の強制改行コードを置換….できない?

Posted on 5月 3, 2022 by Takaaki Naganoya

Keynote v12のスライド(ページ)内のタイトル(default title item)内のテキスト(object text)の強制改行を置換(削除)できないという件についての試行錯誤です。

もともと、v12以前のバージョンのKeynoteでは、LF+LFを削除することで、タイトル内のテキストの改行削除は行えていました。

ただ、同様の処理では強制改行を削除し切れないようで….

--> {"AppleSript+NSImageでよく使う

基礎的な処理一覧", "画像ファイル
変換処理", "画像回転処理", "画像ファイルからの

情報取得処理", "画像リサイズ処理", "画像フィルタ処理"}

いまひとつすっきりしません。

Keynoteのタイトル文字列をコピーして、CotEditor(文字コードをAppleScriptと同じUTF16BEに変更)の書類上にペーストすると0Ahと表示するのですが、どうもKeynote上では異なるようで困ります。

AppleScript名:Keynote v12上の選択中のスライドのタイトルをテキスト化(改行削除)(未遂).scpt
—
–  Created by: Takaaki Naganoya
–  Created on: 2022/05/03
—
–  Copyright © 2022 Piyomaru Software, All Rights Reserved
—
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"

set repTargList to {string id 10 & string id 10, string id 10, string id 11, string id 13} –LF,CR,VTab一括置換

tell application "Keynote"
  tell front document
    set aSel to selection
    
set aList to {}
    
    
repeat with i in aSel
      set tmpClass to class of i
      
if tmpClass = slide then
        set tmpStr0 to object text of default title item of i
        
set hexList to retHexDumpedStr(tmpStr0) of me
        
set tmpStr1 to (paragraphs of tmpStr0) –パラグラフごとにlistにしてみた
        
log tmpStr1
        
set tmpStr2 to replaceTextMultiple(tmpStr1 as string, repTargList, "") of me as string
        
set the end of aList to tmpStr2
      end if
    end repeat
  end tell
end tell

return aList

–文字列の前後の改行と空白文字を除去
on cleanUpText(someText)
  set theString to current application’s NSString’s stringWithString:someText
  
set theString to theString’s stringByReplacingOccurrencesOfString:" +" withString:" " options:(current application’s NSRegularExpressionSearch) range:{location:0, |length|:length of someText}
  
set theWhiteSet to current application’s NSCharacterSet’s whitespaceAndNewlineCharacterSet()
  
set theString to theString’s stringByTrimmingCharactersInSet:theWhiteSet
  
return theString as text
end cleanUpText

–指定文字列からCRLFを除去
on cleanUpCRLF(aStr)
  set aString to current application’s NSString’s stringWithString:aStr
  
set bString to aString’s stringByReplacingOccurrencesOfString:(string id 10) withString:"" –remove LF
  
set cString to bString’s stringByReplacingOccurrencesOfString:(string id 13) withString:"" –remove CR
  
set dString to cString as string
  
return dString
end cleanUpCRLF

–文字置換ルーチン
on repChar(origText as string, targStr as string, repStr as string)
  set {txdl, AppleScript’s text item delimiters} to {AppleScript’s text item delimiters, targStr}
  
set temp to text items of origText
  
set AppleScript’s text item delimiters to repStr
  
set res to temp as text
  
set AppleScript’s text item delimiters to txdl
  
return res
end repChar

–任意のデータから特定の文字列を複数パターン一括置換
on replaceTextMultiple(origData as string, origTexts as list, repText as string)
  set curDelim to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to origTexts
  
set origData to text items of origData
  
set AppleScript’s text item delimiters to {repText}
  
set origData to origData as text
  
set AppleScript’s text item delimiters to curDelim
  
return origData
end replaceTextMultiple

on hexDumpString(aStr as string)
  set theNSString to current application’s NSString’s stringWithString:aStr
  
set theNSData to theNSString’s dataUsingEncoding:(current application’s NSUTF8StringEncoding)
  
set theString to (theNSData’s |debugDescription|()’s uppercaseString())
  
  
–Remove "<" ">" characters in head and tail
  
set tLength to (theString’s |length|()) – 2
  
set aRange to current application’s NSMakeRange(1, tLength)
  
set theString2 to theString’s substringWithRange:aRange
  
  
–Replace Space Characters
  
set aString to current application’s NSString’s stringWithString:theString2
  
set bString to aString’s stringByReplacingOccurrencesOfString:" " withString:""
  
  
set aResList to splitString(bString, 2)
  
–> {​​​​​"E3", ​​​​​"81", ​​​​​"82", ​​​​​"E3", ​​​​​"81", ​​​​​"84", ​​​​​"E3", ​​​​​"81", ​​​​​"86", ​​​​​"E3", ​​​​​"81", ​​​​​"88", ​​​​​"E3", ​​​​​"81", ​​​​​"8A"​​​}
  
  
return aResList
end hexDumpString

–Split NSString in specified aNum characters
on splitString(aText, aNum)
  set aStr to current application’s NSString’s stringWithString:aText
  
if aStr’s |length|() ≤ aNum then return aText
  
  
set anArray to current application’s NSMutableArray’s new()
  
set mStr to current application’s NSMutableString’s stringWithString:aStr
  
  
set aRange to current application’s NSMakeRange(0, aNum)
  
  
repeat while (mStr’s |length|()) > 0
    if (mStr’s |length|()) < aNum then
      anArray’s addObject:(current application’s NSString’s stringWithString:mStr)
      
mStr’s deleteCharactersInRange:(current application’s NSMakeRange(0, mStr’s |length|()))
    else
      anArray’s addObject:(mStr’s substringWithRange:aRange)
      
mStr’s deleteCharactersInRange:aRange
    end if
  end repeat
  
  
return (current application’s NSArray’s arrayWithArray:anArray) as list
end splitString

–与えられたデータ内容をhexdumpして返す
on retHexDumpedStr(aStr)
  set aRes to do shell script "echo " & quoted form of aStr & " | hexdump -v "
  
return aRes
end retHexDumpedStr

★Click Here to Open This Script 

(Visited 41 times, 1 visits today)
Posted in Object control Text | Tagged 10.15savvy 11.0savvy 12.0savvy Keynote | Leave a comment

電子書籍(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