カラーリストまわりの情報を取得するAppleScriptです。
カラーピッカーで取得できる各種色セットの内容を取得できたりと、割と使いでがあります。
AppleScript名:使用可能なカラーリスト名称一覧を取得.scptd |
— – Created by: Takaaki Naganoya – Created on: 2020/07/26 — – Copyright © 2020 Piyomaru Software, All Rights Reserved — use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set cList to ((current application’s NSColorList’s availableColorLists())’s valueForKeyPath:"name") as list –> {"Apple", "System", "World", "Europe", "Japanese", "Scrivener", "AquaPro", "Crayons", "Web セーフカラー"} |
AppleScript名:指定名称のカラーリストに登録されているNSColorを配列で取得.scptd |
— – Created by: Takaaki Naganoya – Created on: 2020/07/26 — – Copyright © 2020 Piyomaru Software, All Rights Reserved — use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set aColList to (current application’s NSColorList’s colorListNamed:"Crayons") set kList to (aColList’s allKeys()) as list set colList to {} repeat with i in kList set j to contents of i set cVal to (aColList’s colorWithKey:j) set the end of colList to cVal end repeat return colList |
More from my site
(Visited 74 times, 1 visits today)