« [Distiller]PSファイルをPDFに変換する | トップページ | [Fonts]コレクションにフォントを追加する »

[Font]font collection

自分用
フォントウェイト分け部分のみ
-->注意

ダウンロード - makefontcollections.scpt.zip

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions


###############起動を待つ(FontBookの提携必須)
tell application "Font Book" to launch
repeat
try
tell application "Font Book"
activate
properties
end tell
exit repeat
on error
delay 0.5
end try
end repeat
########フォントライブラリの一覧を取得
tell application "Font Book"
properties
set listFontCollections to name of every font collection as list
end tell
####################コレクション作成
set strFontCollectionsName to "100:Thin" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "200:Extra Light" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "300:Light" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "400:Regular" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "500:Medium" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "600:Demi Bold" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "700:Bold" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "800:Extra Bold" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "900:Heavy" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "950:Extra Black" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "Oblique" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成
set strFontCollectionsName to "Italic" as text
set boolSameCollections to 0
repeat with objFontCollections in listFontCollections
set strFontCollections to objFontCollections as text
if strFontCollections is strFontCollectionsName then
set boolSameCollections to 1
end if
end repeat
if boolSameCollections is 0 then
tell application "Font Book"
make new font collection with properties {name:strFontCollectionsName}
end tell
end if
####################コレクション作成

|

« [Distiller]PSファイルをPDFに変換する | トップページ | [Fonts]コレクションにフォントを追加する »

AppleScript Fonts」カテゴリの記事