AppleScript Illustrator

TSV2AdobeXML タブ区切りテキストからAdobe Illustratorの変数印字用の『変数ライブラリ』を生成する(1ページに複数面付け版)

TSV2AdobeXML タブ区切りテキストからAdobe Illustratorの変数印字用の『変数ライブラリ』を生成する
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-bba3c3.html

複数項目を1ページ内に面付けする用

ダウンロード - tsv2adobexml4entries.zip



【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe
TSVタブ区切りテキストから
Adobe Illustrator用の変数用のXMLを生成します

設定項目で1ページに面付けする数を設定してください
デフォルトは10です
-->1ページに10件分のデータを割り付けます

【制限事項】その1
TSVの1行目の項目がデータセット名になります
表の1行目が項目名称になるようなTSVで利用してください
【制限事項】その2
可変テキストのみ設定可能です
他の要素の付与はご相談ください
*)
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807
set appFileManager to refMe's NSFileManager's defaultManager()

#################################
### 【1】設定項目
#################################
#1ページの面付け数
set numPageEntries to 10 as integer

#################################
### 【1】入力ファイル
#################################
#ダイアログ
tell current application
  set strName to name as text
end tell
#スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
#デフォルトロケーション
tell application "Finder"
  set aliasPathToMe to (path to me) as alias
  set aliasContainerDir to (container of aliasPathToMe) as alias
end tell
#
set listUTI to {"public.tab-separated-values-text"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location aliasContainerDir of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
if aliasFilePath is (missing value) then
return "選んでください"
end if
#ファイルパス
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
#################################
### 【2】保存先
#################################
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
set aliasContainerDirPath to (ocidContainerDirPathURL's absoluteURL()) as alias
set strMes to "フォルダを選んでください" as text
set strPrompt to "保存先フォルダを選択してください\n同名ファイルがある場合\n『上書き』になります" as text
try
  ###ダイアログを前面に出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else
    tell current application to activate
  end if
  #
  set aliasResponse to (choose folder strMes with prompt strPrompt default location aliasContainerDirPath with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
#戻り値エイリアスをURLに
set strSaveDirPath to (POSIX path of aliasResponse) as text
set ocidSaveDirPathStr to (refMe's NSString's stringWithString:(strSaveDirPath))
set ocidSaveDirPath to ocidSaveDirPathStr's stringByStandardizingPath()
set ocidSaveDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveDirPath) isDirectory:true)
##出力用ファイルパス
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("variables.xml")
#################################
### 【3】本処理
#################################
#ファイル読み込み
set listResponse to (refMe's NSString's alloc()'s initWithContentsOfURL:(ocidFilePathURL) usedEncoding:(refMe's NSUTF8StringEncoding) |error|:(reference))
set ocidReadString to (item 1 of listResponse)
if ocidReadString = (missing value) then
return "文字コードを判定出来ませんでした : " & strFileName
end if

#改行コードをUNIXに強制
set ocidCRChar to refMe's NSString's stringWithString:("\r")
set ocidLFChar to refMe's NSString's stringWithString:("\n")
set ocidCRLFChar to refMe's NSString's stringWithString:("\r\n")
set ocidReadStringsA to ocidReadString's stringByReplacingOccurrencesOfString:(ocidCRLFChar) withString:(ocidLFChar)
set ocidReadStrings to ocidReadStringsA's stringByReplacingOccurrencesOfString:(ocidCRChar) withString:(ocidLFChar)

#改行毎でリストにする
set ocidCharSet to (refMe's NSCharacterSet's newlineCharacterSet)
set ocidLineArray to (ocidReadStrings's componentsSeparatedByCharactersInSet:(ocidCharSet))

#出力用のリスト
set ocidEditLineArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)

#読み取ったデータに項目連番を入れておく
set numCntLineNo to 0 as integer
repeat with itemLineArray in ocidLineArray
  set ocidEditLineText to (refMe's NSMutableString's alloc()'s initWithCapacity:(0))
  if numCntLineNo = 0 then
    set strAppendText to ("rowno\t") as text
(ocidEditLineText's appendString:(strAppendText))
(ocidEditLineText's appendString:(itemLineArray))
  else
    if (itemLineArray as text) is "" then
      exit repeat
    end if
    #タブ区切りで挿入
    set strAppendText to (numCntLineNo & "\t") as text
(ocidEditLineText's appendString:(strAppendText))
(ocidEditLineText's appendString:(itemLineArray))
  end if
(ocidEditLineArray's addObject:(ocidEditLineText))
  #カウントアップ
  set numCntLineNo to (numCntLineNo + 1) as integer
end repeat

#最初の1行目だけ別で取得しておく
set ocidFirstObjectString to ocidEditLineArray's firstObject()
set ocidFirstRowArray to ocidFirstObjectString's componentsSeparatedByString:("\t")

################################
###XML初期化
set ocidXMLDoc to refMe's NSXMLDocument's alloc()'s init()
ocidXMLDoc's setVersion:("1.0")
ocidXMLDoc's setCharacterEncoding:("utf-8")
ocidXMLDoc's setDocumentContentKind:(refMe's NSXMLDocumentXMLKind)
###DTD生成
set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
ocidDTD's setName:("svg")
ocidDTD's setPublicID:("-//W3C//DTD SVG 20001102//EN")
ocidDTD's setSystemID:("http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd")
#Entitry付与
set strEntitry to ("<!ENTITY ns_graphs \"http://ns.adobe.com/Graphs/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_vars \"http://ns.adobe.com/Variables/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_imrep \"http://ns.adobe.com/ImageReplacement/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_custom \"http://ns.adobe.com/GenericCustomNamespace/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_flows \"http://ns.adobe.com/Flows/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_extend \"http://ns.adobe.com/Extensibility/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
##DTDをXMLDOCにセット
ocidXMLDoc's setDTD:(ocidDTD)
###ROOTエレメント
set ocidRootElement to refMe's NSXMLElement's elementWithName:("svg")
#【1】variableSets
set ocidVsetsElement to refMe's NSXMLElement's elementWithName:("variableSets")
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("") stringValue:("&ns_vars;")
ocidVsetsElement's addNamespace:(ocidSetNameSpace)

#【2】variableSet
set ocidVsetElement to refMe's NSXMLElement's elementWithName:("variableSet")
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("varSetName") stringValue:("binding1"))
(ocidVsetElement's addAttribute:(ocidAddNode))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("locked") stringValue:("none"))
(ocidVsetElement's addAttribute:(ocidAddNode))

#【3−1】variables
set ocidVariablesElement to refMe's NSXMLElement's elementWithName:("variables")
################
#【3−2】variable
(*
可変テキスト:trait="textcontent" category="&ns_flows;"
フィアルパス:trait="fileref" category="&ns_vars;"
表示有無:trait="visibility" category="&ns_vars;"
表示有無?:trait="graphdata" category="&ns_graphs;"
*)
###########################
##ページレイアウト
###########################
repeat with itemEntries from 1 to numPageEntries by 1
  #【3−2−1】連番用の追加項目
  set ocidVariableElement to (refMe's NSXMLElement's elementWithName:("variable"))
  
  #【3−2−2】読み込みデータの項目
  repeat with itemFirstRowArray in ocidFirstRowArray
    set strFirstRowArray to itemFirstRowArray as text
    set ocidVariableElement to (refMe's NSXMLElement's elementWithName:("variable"))
    #ページのエントリー数を入れる
    set strSetVarName to ("E" & itemEntries & "-" & strFirstRowArray) as text
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("varName") stringValue:(strSetVarName))
(ocidVariableElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("category") stringValue:("&ns_flows;"))
(ocidVariableElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("trait") stringValue:("textcontent"))
(ocidVariableElement's addAttribute:(ocidAddNode))
    #【3−2−2】variableを【3−1】variablesにセット
(ocidVariablesElement's addChild:(ocidVariableElement))
  end repeat
end repeat

################
#【4−1】DataSets
set ocidDataSetsElement to refMe's NSXMLElement's elementWithName:("v:sampleDataSets")
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("v") stringValue:("&ns_vars;")
ocidDataSetsElement's addNamespace:(ocidSetNameSpace)
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("") stringValue:("&ns_custom;")
ocidDataSetsElement's addNamespace:(ocidSetNameSpace)

################
#【4−2】DataSet
#データのリスト行数 先頭行の項目名行を除くので1引く
set numCntEditArray to ((count of ocidEditLineArray) - 1) as integer
#データの行数から何ページ分のデータ=dataSetの数
set numMakePage to (round of (numCntEditArray / numPageEntries) rounding up) as integer
#取り出すデータ行番号初期化
set numCntRowNoAll to 1 as integer
#作成される予定ページ数=dataSetの数ぶん繰り返す
repeat with itemdataSet from 1 to numMakePage by 1
  #【4−2】DataSetのエレメント
  set ocidDataSetElement to (refMe's NSXMLElement's elementWithName:("v:sampleDataSet"))
  #DataSetのアトリビュートに項目番号+2列目のデータで命名する
  set strSetDataSetName to (itemdataSet & ":ページ目") as text
  #↑の内容でdataSetNameをセット
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("dataSetName") stringValue:(strSetDataSetName))
(ocidDataSetElement's addAttribute:(ocidAddNode))
  #1ページに入る行目数分くりかえし
  repeat with itemPageEntries from 1 to numPageEntries by 1
    #指定行数の行データを取得
    set ocidRowStrings to (ocidEditLineArray's objectAtIndex:(numCntRowNoAll))
    #区切り文字タブでリストにして
    set ocidRowArray to (ocidRowStrings's componentsSeparatedByString:("\t"))
    #OS用の0スタートで行の項目数
    set numCntRowItemAll to ((count of ocidRowArray) - 1) as integer
    #行項目のリストから取得するための項目数初期化
    set numCntRowItem to 0 as integer
    #項目の数だけ繰り返し
    repeat with itemFirstRowArray in ocidFirstRowArray
      #ページ内での項目数+項目名でセット
      set strSetVarName to ("E" & itemPageEntries & "-" & itemFirstRowArray) as text
      set ocidDataSetChildElement to (refMe's NSXMLElement's elementWithName:(strSetVarName))
      #対象行列データを取得
      set strSetValieRowItem to (ocidRowArray's objectAtIndex:(numCntRowItem)) as text
      #Pエレメント内にテキストとして値をセット
      set ocidPElement to (refMe's NSXMLElement's elementWithName:("p"))
(ocidPElement's setStringValue:(strSetValieRowItem))
(ocidDataSetChildElement's addChild:(ocidPElement))
(ocidDataSetElement's addChild:(ocidDataSetChildElement))
      #カウントアップ
      set numCntRowItem to (numCntRowItem + 1) as integer
    end repeat
    set numCntRowNoAll to numCntRowNoAll + 1 as integer
    #データ行項目数より行カウンターが多くなったら終わり
    if numCntRowNoAll > (numCntEditArray) then
      exit repeat
    end if
  end repeat
  #【4−2】DataSetを【4−1】DataSetsにセット
(ocidDataSetsElement's addChild:(ocidDataSetElement))
end repeat

#【3−1】variablesを【2】のvariableSetにセット
ocidVsetElement's addChild:(ocidVariablesElement)
#【4−1】DataSetsを【2】のvariableSetにセット
ocidVsetElement's addChild:(ocidDataSetsElement)
#【2】variableSetを【1】のvariableSetsにセット
ocidVsetsElement's addChild:(ocidVsetElement)
#【1】のvariableSetsをROOTにセット
ocidRootElement's addChild:(ocidVsetsElement)
#
################################
###保存
ocidXMLDoc's setRootElement:(ocidRootElement)
###NSXMLNodePrettyPrint形式でデータにして
###NSXMLNodeCompactEmptyElementにすると少しデータサイズが節約できる
set ocidXMLdata to ocidXMLDoc's XMLDataWithOptions:(refMe's NSXMLNodeExpandEmptyElement)
###データをテキストに戻して
set ocidXMLString to refMe's NSString's alloc()'s initWithData:(ocidXMLdata) encoding:(refMe's NSUTF8StringEncoding)
###改行コードをWindowsに
set ocidSaveStrings to ocidXMLString's stringByReplacingOccurrencesOfString:(ocidLFChar) withString:(ocidCRLFChar)
###保存
set listDone to (ocidSaveStrings's writeToURL:(ocidSaveFilePathURL) atomically:true encoding:(refMe's NSUTF8StringEncoding) |error|:(reference))

return




|

TSV2AdobeXML タブ区切りテキストからAdobe Illustratorの変数印字用の『変数ライブラリ』を生成する

TSV2AdobeXML タブ区切りテキストからAdobe Illustratorの変数印字用の『変数ライブラリ』を生成する(1ページに複数面付け版)
https://quicktimer.cocolog-nifty.com/icefloe/2024/03/post-143f05.html
もあります
このページのスクリプトは1ページに1項目版です

変数パネルを使った可変テキスト
1:変数パネルを出す
2:変数パネル
3:ハンバーガーから『変数ライブラリの読み込み』
4:読み込んだ状態
5:テキストオブジェクトを生成して
6:使用したい変数を選択してから『テキスト動的に設定』を実行
7:動作確認

ダウンロード - makevariables.zip


1:変数パネルを出す
1_20240306130101
2:変数パネル
2_20240306130101
3:ハンバーガーから『変数ライブラリの読み込み』
3_20240306130101
4:読み込んだ状態
4_20240306130101
5:テキストオブジェクトを生成して
5_20240306130101
6:使用したい変数を選択してから『テキスト動的に設定』を実行
6_20240306130101
7:動作確認
7_20240306130101


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe
TSVタブ区切りテキストから
Adobe Illustrator用の変数用のXMLを生成します
【制限事項】その1
TSVの1行目の項目がデータセット名になります
表の1行目が項目名称になるようなTSVで利用してください
【制限事項】その2
可変テキストのみ設定可能です
他の要素の付与はご相談ください
*)
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807
set appFileManager to refMe's NSFileManager's defaultManager()


#################################
### 【1】入力ファイル
#################################
#ダイアログ
tell current application
  set strName to name as text
end tell
#スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
#デフォルトロケーション
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias
#
set listUTI to {"public.tab-separated-values-text"}
set strMes to ("ファイルを選んでください") as text
set strPrompt to ("ファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location aliasDesktopDirPath of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
if aliasFilePath is (missing value) then
return "選んでください"
end if
#ファイルパス
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
#################################
### 【2】保存先
#################################
set ocidContainerDirPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
set aliasContainerDirPath to (ocidContainerDirPathURL's absoluteURL()) as alias
set strMes to "フォルダを選んでください" as text
set strPrompt to "保存先フォルダを選択してください\n同名ファイルがある場合\n『上書き』になります" as text
try
  ###ダイアログを前面に出す
  set strName to (name of current application) as text
  if strName is "osascript" then
    tell application "Finder" to activate
  else
    tell current application to activate
  end if
  #
  set aliasResponse to (choose folder strMes with prompt strPrompt default location aliasContainerDirPath with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
#戻り値エイリアスをURLに
set strSaveDirPath to (POSIX path of aliasResponse) as text
set ocidSaveDirPathStr to (refMe's NSString's stringWithString:(strSaveDirPath))
set ocidSaveDirPath to ocidSaveDirPathStr's stringByStandardizingPath()
set ocidSaveDirPathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSaveDirPath) isDirectory:true)
##出力用ファイルパス
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:("variables.xml")
#################################
### 【3】本処理
#################################
#ファイル読み込み
set listResponse to (refMe's NSString's alloc()'s initWithContentsOfURL:(ocidFilePathURL) usedEncoding:(refMe's NSUTF8StringEncoding) |error|:(reference))
set ocidReadString to (item 1 of listResponse)
if ocidReadString = (missing value) then
return "文字コードを判定出来ませんでした : " & strFileName
end if

#改行コードをUNIXに強制
set ocidCRChar to refMe's NSString's stringWithString:("\r")
set ocidLFChar to refMe's NSString's stringWithString:("\n")
set ocidCRLFChar to refMe's NSString's stringWithString:("\r\n")
set ocidReadStringsA to ocidReadString's stringByReplacingOccurrencesOfString:(ocidCRLFChar) withString:(ocidLFChar)
set ocidReadStrings to ocidReadStringsA's stringByReplacingOccurrencesOfString:(ocidCRChar) withString:(ocidLFChar)
#改行毎でリストにする
set ocidCharSet to (refMe's NSCharacterSet's newlineCharacterSet)
set ocidLineArray to (ocidReadStrings's componentsSeparatedByCharactersInSet:(ocidCharSet))
#出力用のリスト
set ocidEditLineArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
#読み取ったデータに項目連番を入れておく
set numCntLineNo to 0 as integer
repeat with itemLineArray in ocidLineArray
  set ocidEditLineText to (refMe's NSMutableString's alloc()'s initWithCapacity:(0))
  if numCntLineNo = 0 then
    set strAppendText to ("rowno\t") as text
(ocidEditLineText's appendString:(strAppendText))
(ocidEditLineText's appendString:(itemLineArray))
  else
    if (itemLineArray as text) is "" then
      exit repeat
    end if
    set strAppendText to (numCntLineNo & "\t") as text
(ocidEditLineText's appendString:(strAppendText))
(ocidEditLineText's appendString:(itemLineArray))
  end if
(ocidEditLineArray's addObject:(ocidEditLineText))
  #カウントアップ
  set numCntLineNo to (numCntLineNo + 1) as integer
end repeat

#最初の1行目だけ別で取得しておく
set ocidFirstObjectString to ocidEditLineArray's firstObject()
set ocidFirstRowArray to ocidFirstObjectString's componentsSeparatedByString:("\t")

################################
###XML初期化
set ocidXMLDoc to refMe's NSXMLDocument's alloc()'s init()
ocidXMLDoc's setVersion:("1.0")
ocidXMLDoc's setCharacterEncoding:("utf-8")
ocidXMLDoc's setDocumentContentKind:(refMe's NSXMLDocumentXMLKind)
###DTD生成
set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
ocidDTD's setName:("svg")
ocidDTD's setPublicID:("-//W3C//DTD SVG 20001102//EN")
ocidDTD's setSystemID:("http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd")
#Entitry付与
set strEntitry to ("<!ENTITY ns_graphs \"http://ns.adobe.com/Graphs/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_vars \"http://ns.adobe.com/Variables/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_imrep \"http://ns.adobe.com/ImageReplacement/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_custom \"http://ns.adobe.com/GenericCustomNamespace/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_flows \"http://ns.adobe.com/Flows/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
#Entitry付与
set strEntitry to ("<!ENTITY ns_extend \"http://ns.adobe.com/Extensibility/1.0/\">") as text
set ocidEntitry to refMe's NSString's stringWithString:(strEntitry)
set ocidEntityNode to refMe's NSXMLDTDNode's alloc()'s initWithXMLString:(ocidEntitry)
ocidEntityNode's setDTDKind:(refMe's NSXMLAttributeEntityKind)
ocidDTD's addChild:(ocidEntityNode)
##DTDをXMLDOCにセット
ocidXMLDoc's setDTD:(ocidDTD)
###ROOTエレメント
set ocidRootElement to refMe's NSXMLElement's elementWithName:("svg")
#【1】variableSets
set ocidVsetsElement to refMe's NSXMLElement's elementWithName:("variableSets")
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("") stringValue:("&ns_vars;")
ocidVsetsElement's addNamespace:(ocidSetNameSpace)

#【2】variableSet
set ocidVsetElement to refMe's NSXMLElement's elementWithName:("variableSet")
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("varSetName") stringValue:("binding1"))
(ocidVsetElement's addAttribute:(ocidAddNode))
set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("locked") stringValue:("none"))
(ocidVsetElement's addAttribute:(ocidAddNode))

#【3−1】variables
set ocidVariablesElement to refMe's NSXMLElement's elementWithName:("variables")
################
#【3−2】variable
(*
可変テキスト:trait="textcontent" category="&ns_flows;"
フィアルパス:trait="fileref" category="&ns_vars;"
表示有無:trait="visibility" category="&ns_vars;"
表示有無?:trait="graphdata" category="&ns_graphs;"
*)
#【3−2−1】連番用の追加項目
set ocidVariableElement to (refMe's NSXMLElement's elementWithName:("variable"))

#【3−2−2】読み込みデータの項目
repeat with itemFirstRowArray in ocidFirstRowArray
  set strFirstRowArray to itemFirstRowArray as text
  set ocidVariableElement to (refMe's NSXMLElement's elementWithName:("variable"))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("varName") stringValue:(strFirstRowArray))
(ocidVariableElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("category") stringValue:("&ns_flows;"))
(ocidVariableElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("trait") stringValue:("textcontent"))
(ocidVariableElement's addAttribute:(ocidAddNode))
  #【3−2−2】variableを【3−1】variablesにセット
(ocidVariablesElement's addChild:(ocidVariableElement))
end repeat

################
#【4−1】DataSets
set ocidDataSetsElement to refMe's NSXMLElement's elementWithName:("v:sampleDataSets")
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("v") stringValue:("&ns_vars;")
ocidDataSetsElement's addNamespace:(ocidSetNameSpace)
set ocidSetNameSpace to refMe's NSXMLNode's namespaceWithName:("") stringValue:("&ns_custom;")
ocidDataSetsElement's addNamespace:(ocidSetNameSpace)
################
#【4−2】DataSet
#データのリストの数
set numCntEditArray to (count of ocidEditLineArray) as integer
#データリストの2行目から最後まで繰り返す
repeat with itemIntNo from 1 to (numCntEditArray - 1) by 1
  #【4−2】DataSetのエレメント
  set ocidDataSetElement to (refMe's NSXMLElement's elementWithName:("v:sampleDataSet"))
  #DataSetのアトリビュートに項目番号+2列目のデータで命名する
  set ocidRowStrings to (ocidEditLineArray's objectAtIndex:(itemIntNo))
  set ocidRowArray to (ocidRowStrings's componentsSeparatedByString:("\t"))
  #ここが行番号
  set strRowNo to (ocidRowArray's objectAtIndex:(0)) as text
  #ここが2列目
  set strRowName to (ocidRowArray's objectAtIndex:(1)) as text
  #データセット名にする
  set strSetName to (strRowNo & ":" & strRowName) as text
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("dataSetName") stringValue:(strSetName))
(ocidDataSetElement's addAttribute:(ocidAddNode))
  #【4−2】の子要素の生成
  set numCntFirstRowArray to (count of ocidFirstRowArray) as integer
  repeat with itemIntNo from 0 to (numCntFirstRowArray - 1) by 1
    set ocidFirstRowValue to (ocidFirstRowArray's objectAtIndex:(itemIntNo))
    set ocidDataSetChildElement to (refMe's NSXMLElement's elementWithName:(ocidFirstRowValue))
    #Pパラグラフのエレメントのテキストの値として生成する
    set strSetRowItem to (ocidRowArray's objectAtIndex:(itemIntNo))
    set ocidPElement to (refMe's NSXMLElement's elementWithName:("p"))
    #テキストの値を入れる
(ocidPElement's setStringValue:(strSetRowItem))
(ocidDataSetChildElement's addChild:(ocidPElement))
(ocidDataSetElement's addChild:(ocidDataSetChildElement))
  end repeat
(ocidDataSetsElement's addChild:(ocidDataSetElement))
end repeat

#【3−1】のvariablesを【2】のvariableSetにセット
ocidVsetElement's addChild:(ocidVariablesElement)
#【4−1】DataSetsを【2】のvariableSetにセット
ocidVsetElement's addChild:(ocidDataSetsElement)
#【2】variableSetを【1】のvariableSetsにセット
ocidVsetsElement's addChild:(ocidVsetElement)
#【1】のvariableSetsをROOTにセット
ocidRootElement's addChild:(ocidVsetsElement)
#
################################
###保存
ocidXMLDoc's setRootElement:(ocidRootElement)
###NSXMLNodePrettyPrint形式でデータにして
###NSXMLNodeCompactEmptyElementにすると少しデータサイズが節約できる
set ocidXMLdata to ocidXMLDoc's XMLDataWithOptions:(refMe's NSXMLNodeExpandEmptyElement)
###データをテキストに戻して
set ocidXMLString to refMe's NSString's alloc()'s initWithData:(ocidXMLdata) encoding:(refMe's NSUTF8StringEncoding)
###改行コードをWindowsに
set ocidSaveStrings to ocidXMLString's stringByReplacingOccurrencesOfString:(ocidLFChar) withString:(ocidCRLFChar)
###保存
set listDone to (ocidSaveStrings's writeToURL:(ocidSaveFilePathURL) atomically:true encoding:(refMe's NSUTF8StringEncoding) |error|:(reference))

return




|

イラストレーター用バリアブル印刷用XMLの初期化(途中)

【スクリプトエディタで開く】

#!/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

property refMe : a reference to current application


#################################
########### DTD
#################################
set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
ocidDTD's setPublicID:"-//W3C//DTD SVG 20001102//EN"
ocidDTD's setSystemID:"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd"
ocidDTD's setName:"svg"


#################################
### NSXMLDTDNode ここでは ENTITY
#################################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_graphs"
ocidDTDNode's setStringValue:"http://ns.adobe.com/Graphs/1.0/"
ocidDTD's addChild:ocidDTDNode

################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_vars"
ocidDTDNode's setStringValue:"http://ns.adobe.com/Variables/1.0/"
ocidDTD's addChild:ocidDTDNode

################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_imrep"
ocidDTDNode's setStringValue:"http://ns.adobe.com/ImageReplacement/1.0/"
ocidDTD's addChild:ocidDTDNode

################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_custom"
ocidDTDNode's setStringValue:"http://ns.adobe.com/GenericCustomNamespace/1.0/"
ocidDTD's addChild:ocidDTDNode

################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_flows"
ocidDTDNode's setStringValue:"http://ns.adobe.com/Flows/1.0/"
ocidDTD's addChild:ocidDTDNode

################
set ocidDTDNode to refMe's NSXMLDTDNode's alloc()'s initWithKind:(refMe's NSXMLAttributeIDRefsKind) options:(refMe's NSXMLNodeLoadExternalEntitiesAlways)
ocidDTDNode's setName:"ns_extend"
ocidDTDNode's setStringValue:"http://ns.adobe.com/Extensibility/1.0/"
ocidDTD's addChild:ocidDTDNode


#################################
########### Root element
#################################
set ocidRootElement to refMe's NSXMLElement's alloc()'s initWithName:"svg"
#################################
########### variableSets element
#################################
set ocidVariableSets to refMe's NSXMLElement's alloc()'s initWithName:"variableSets"
set ocidNameSpaceNode to refMe's NSXMLNode's namespaceWithName:"" stringValue:"&ns_vars;"
ocidVariableSets's addNamespace:ocidNameSpaceNode
ocidRootElement's addChild:ocidVariableSets

#################################
########### variableSet element
#################################
set ocidVariableSet to refMe's NSXMLElement's alloc()'s initWithName:"variableSet"
set ocidVariableSetNode to refMe's NSXMLNode's attributeWithName:"varSetName" stringValue:"データセット名"
ocidVariableSet's addAttribute:ocidVariableSetNode
set ocidVariableSetNode to refMe's NSXMLNode's attributeWithName:"locked" stringValue:"none"
ocidVariableSet's addAttribute:ocidVariableSetNode
ocidVariableSets's addChild:ocidVariableSet
#################################
########### variables element
#################################
set ocidVariables to refMe's NSXMLElement's alloc()'s initWithName:"variables"
ocidVariableSet's addChild:ocidVariables
#################################
########### variable element
#################################
set ocidVariable to refMe's NSXMLElement's alloc()'s initWithName:"variable"
set ocidVariableNode to refMe's NSXMLNode's attributeWithName:"varName" stringValue:"可変:名前"
ocidVariable's addAttribute:ocidVariableNode
set ocidVariableNode to refMe's NSXMLNode's attributeWithName:"trait" stringValue:"textcontent"
ocidVariable's addAttribute:ocidVariableNode
set ocidVariableNode to refMe's NSXMLNode's attributeWithName:"category" stringValue:"http://ns.adobe.com/Flows/1.0/"
ocidVariable's addAttribute:ocidVariableNode
ocidVariables's addChild:ocidVariable

#################################
########### sampleDataSets element
#################################
set ocidSampleDataSets to refMe's NSXMLElement's alloc()'s initWithName:"v:sampleDataSets"
set ocidNameSpaceNode to refMe's NSXMLNode's namespaceWithName:"" stringValue:"http://ns.adobe.com/GenericCustomNamespace/1.0/"
ocidSampleDataSets's addNamespace:ocidNameSpaceNode
set ocidNameSpaceNode to refMe's NSXMLNode's namespaceWithName:"v" stringValue:"http://ns.adobe.com/Variables/1.0/"
ocidSampleDataSets's addNamespace:ocidNameSpaceNode
ocidVariableSet's addChild:ocidSampleDataSets

#################################
########### sampleDataSet element
#################################
set ocidSampleDataSet to refMe's NSXMLElement's alloc()'s initWithName:"v:sampleDataSet"
set ocidSampleDataSetNode to refMe's NSXMLNode's attributeWithName:"dataSetName" stringValue:"可変:セット1"
ocidSampleDataSet's addAttribute:ocidSampleDataSetNode
ocidSampleDataSets's addChild:ocidSampleDataSet

#################################
########### 可変データセット1
#################################
set ocidSampleDataSetItem to refMe's NSXMLElement's alloc()'s initWithName:"可変:名前"
ocidSampleDataSet's addChild:ocidSampleDataSetItem

#################################
########### 可変データセット1 の項目1
#################################
set ocidSampleDataSetItemP to refMe's NSXMLElement's alloc()'s initWithName:"p"
ocidSampleDataSetItem's addChild:ocidSampleDataSetItemP
ocidSampleDataSetItemP's setStringValue:"名前データ"

#################################
###NSXMLDocument を生成する
#################################
set ocidOutPutXML to refMe's NSXMLDocument's alloc()'s initWithRootElement:ocidRootElement
ocidOutPutXML's setVersion:"1.0"
ocidOutPutXML's setCharacterEncoding:"UTF-8"
#####DTDを追加
ocidOutPutXML's setDTD:ocidDTD

#################################
###改行コード変換
#################################
####テキスト形式に戻して
set ocidXMLstrings to ocidOutPutXML's XMLString()
####改行コードをCRLF WINDOWSにする
###StringValue内に改行があると置き換えちゃうのでこれはNG
##set ocidCRLFstrings to ocidXMLstrings's stringByReplacingOccurrencesOfString:"\n" withString:"\r\n"
###XMLStringには改行が含まれないためWindows改行にするには最後にWINDOW改行を入れれば良い
ocidCRLFstrings's appendString:"\r\n"
########
(* わざわざ正規表現使わなくても
set ocidCRLFstrings to refMe's NSMutableString's alloc()'s initWithCapacity:0
ocidCRLFstrings's setString:ocidXMLstrings
set ocidRange to ocidXMLstrings's rangeOfString:ocidCRLFstrings
ocidCRLFstrings's replaceOccurrencesOfString:"(>)\n" withString:"$1\r\n" options:(refMe's NSRegularExpressionSearch) range:ocidRange
ocidCRLFstrings's replaceOccurrencesOfString:"(>)$" withString:"$1\r\n" options:(refMe's NSRegularExpressionSearch) range:ocidRange
ocidCRLFstrings's replaceOccurrencesOfString:"\n$" withString:"$1\r\n" options:(refMe's NSRegularExpressionSearch) range:ocidRange
*)
####################
####保存
####################
####ファイルパス
set strSaveFilePath to "~/Desktop/AiVariables.xml" as text
set ocidSaveFilePathStr to refMe's NSString's stringWithString:strSaveFilePath
set ocidSaveFilePath to ocidSaveFilePathStr's stringByStandardizingPath()
set ocidSaveFilePathURL to refMe's NSURL's fileURLWithPath:ocidSaveFilePath

####################
#####UTF8でテキストデータにして
set ocidCFLFdata to ocidCRLFstrings's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
###NSDATAとして保存
set listResults to ocidCFLFdata's writeToURL:ocidSaveFilePathURL options:(refMe's NSDataWritingAtomic) |error|:(reference)

|

[Illustrator]配置画像をファイル名のレイヤを作成してそこに移動する

#!/usr/bin/env osascript

----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

#

# 配置画像を個別のレイヤーに移動します

#レイヤ名にリンク画像は Link: 

#埋め込み画像は 埋込:を付与してレイヤを作成する+版

# com.cocolog-nifty.quicktimer.icefloe

----+----1----+----2----+-----3----+----4----+----5----+----6----+----7


use AppleScript version "2.4"

use framework "Foundation"

use scripting additions


property refMe : a reference to current application

property refNSString : a reference to refMe's NSString



tell application "Adobe Illustrator"

activate

tell the current document

########レイヤーの数を数える

set numLayerNo to (do javascript "app.activeDocument.layers.length;") as text

set numCnt to 0 as number

repeat numLayerNo times

##レイヤーの名前の取得部

do javascript "app.activeDocument.activeLayer= app.activeDocument.layers[" & numCnt & "];"

do javascript "app.activeDocument.activeLayer.name;"

set numCnt to numCnt + 1 as number

end repeat

end tell

end tell

tell application "Adobe Illustrator"

activate

tell the current document

########埋め込みラスタ画像の数を数える

do javascript "app.activeDocument.selection;"

set numSelectionCnt to (do javascript "app.activeDocument.rasterItems.length;") as text

end tell

end tell

set numCnt to 0 as number

repeat numSelectionCnt times

##

tell application "Adobe Illustrator"

activate

tell the current document

########埋め込みラスタ画像の名前を取得する

set strFileNamet to (do javascript "app.activeDocument.rasterItems[" & numCnt & "].file.name;") as text

end tell

end tell

###文字化けファイル名を読める形にする

set strFileNamet to ("埋込:" & decodeURL(strFileNamet)) as text

tell application "Adobe Illustrator"

activate

tell the current document

########ファイル名でレイヤー名を作成

do javascript "var objRastFile=app.activeDocument.rasterItems[" & numCnt & "];"

do javascript "var objNewLayer=app.activeDocument.layers.add();"

do javascript "objNewLayer.name=\"" & strFileNamet & "\""

##レイヤに移動する

do javascript "objRastFile.move(objNewLayer, ElementPlacement.PLACEATBEGINNING);"

end tell

end tell

set numCnt to numCnt + 1 as number

end repeat




tell application "Adobe Illustrator"

activate

tell the current document

########リンク画像の数を数える

set numSelectionCnt to (do javascript "app.activeDocument.placedItems.length;") as text

end tell

end tell

set numCnt to 0 as number

repeat numSelectionCnt times

##

tell application "Adobe Illustrator"

tell the current document

########リンク画像のファイル名を取得する

set strFileNamet to (do javascript "app.activeDocument.placedItems[" & numCnt & "].file.name;") as text

end tell

end tell

###文字化けファイル名を読める形にする

set strFileNamet to ("Link:" & decodeURL(strFileNamet)) as text

tell application "Adobe Illustrator"

activate

tell the current document

########ファイル名でレイヤー名を作成

do javascript "var objPlacedFile=app.activeDocument.placedItems[" & numCnt & "];"

do javascript "var objNewLayer=app.activeDocument.layers.add();"

do javascript "objNewLayer.name=\"" & strFileNamet & "\""

##レイヤに移動する

do javascript "objPlacedFile.move(objNewLayer, ElementPlacement.PLACEATBEGINNING);"

end tell

end tell


set numCnt to numCnt + 1 as number

end repeat


####%エンコードされたファイル名をデコードするサブルーチン

on decodeURL(theText)

set ocidStringText to refNSString's stringWithString: theText

set ocidEncodedText to ocidStringText's stringByRemovingPercentEncoding()

set strEncodedText to ocidEncodedText as text

return strEncodedText

end decodeURL

|

[Illustrator]アートボードサイズの長方形を描く

アートボードサイズの長方形を描く
https://3fl.jp/is041/
こちらのアップルスクリプト版

ダウンロード - draw_rectangle_by_artboard_siz.zip

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions




####イラストレータでの処理はここから
tell application "Adobe Illustrator"
###全面の処理するファイルを定義
try
set activDoc to current document
on error
return "ドキュメントがありません"
error number -128
end try
tell activDoc
####カラースペース
set strColorSpace to (color space) as text
###
set listCropMarks to crop marks as list
set numWidth to width as number
set numHeight to height as number
set numXa to item 1 of listCropMarks as number
set numYa to item 2 of listCropMarks as number
set numXb to item 3 of listCropMarks as number
set numYb to item 4 of listCropMarks as number
###最上部にレイヤ追加(前面= front)
##make layer at front with properties {name:strLayerName}
set strLayerName to ("Background") as text
###最下部にレイヤ追加
make layer at end with properties {name:strLayerName}
####作ったレイヤ
tell layer strLayerName
###レイヤ追加
set strBkLayerName to ("BasePath")
make layer at end with properties {name:strBkLayerName}
###
tell layer strBkLayerName
set strBackgroundPathName to ("BackgroundPath")

if strColorSpace is "CMYK" then
## fill color:{class:CMYK color info, cyan:0.0, magenta:0.0, yellow:0.0, black:0.0}, fill overprint:false,
make new path item with properties {closed:true, guides:false, filled:false, stroked:false, clipping:false, evenodd:false, resolution:720.0, entire path:{{class:path point info, anchor:{numXb, numYb}, left direction:{numXb, numYb}, right direction:{numXb, numYb}, point type:corner}, {class:path point info, anchor:{numXa, numYb}, left direction:{numXa, numYb}, right direction:{numXa, numYb}, point type:corner}, {class:path point info, anchor:{numXa, numYa}, left direction:{numXa, numYa}, right direction:{numXa, numYa}, point type:corner}, {class:path point info, anchor:{numXb, numYa}, left direction:{numXb, numYa}, right direction:{numXb, numYa}, point type:corner}}, polarity:positive, URL:"", note:"", locked:false, hidden:false, selected:true, position:{numXa, numYa}, width:numWidth, height:numHeight, geometric bounds:listCropMarks, name:strBackgroundPathName, blend mode:normal, opacity:100.0, isolated:false, knockout:disabled, editable:true, sliced:false, pixel aligned:false, wrapped:false}
else
### fill color:{class:RGB color info, red:255.0, green:255.0, blue:255.0}, fill overprint:false,
make new path item with properties {closed:true, guides:false, filled:false, stroked:false, clipping:false, evenodd:false, resolution:720.0, entire path:{{class:path point info, anchor:{numXb, numYb}, left direction:{numXb, numYb}, right direction:{numXb, numYb}, point type:corner}, {class:path point info, anchor:{numXa, numYb}, left direction:{numXa, numYb}, right direction:{numXa, numYb}, point type:corner}, {class:path point info, anchor:{numXa, numYa}, left direction:{numXa, numYa}, right direction:{numXa, numYa}, point type:corner}, {class:path point info, anchor:{numXb, numYa}, left direction:{numXb, numYa}, right direction:{numXb, numYa}, point type:corner}}, polarity:positive, URL:"", note:"", locked:false, hidden:false, selected:true, position:{numXa, numYa}, width:numWidth, height:numHeight, geometric bounds:listCropMarks, name:strBackgroundPathName, blend mode:normal, opacity:100.0, isolated:false, knockout:disabled, editable:true, sliced:false, pixel aligned:false, wrapped:false}
end if
set locked to true
end tell
set locked to true
end tell
end tell
end tell

|

[Illustrator]文字の置き換え

#!/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


###アプリケーション
tell application "Adobe Illustrator"
###前面のドキュメントを定義
set activDoc to current document
###値をリストに格納するための初期化
set listSelectFrame to {} as list
###全面のドキュメントに対してのみ処理
tell activDoc
###選択中のテキストをリストに
set listSelectFrame to every text frame whose selected is true
###選んだテキストフレームの数を数えておく
set numCntEveryFrame to count of listSelectFrame
-->テキストフレームを指定しているのでここで他の要素は除外されている
###全部対象の場合はこちら
##set listSelectFrame to every text frame
###繰り返しの初期化
set numSelectFrameNo to 0
###選択したテキストフレームの繰り返し
#####この方法だと最後の1つを誤認識する
repeat with objSelectFrame in listSelectFrame
###カウントアップ
set numSelectFrameNo to numSelectFrameNo + 1
###種類を調べて
set classKind to kind of objSelectFrame
###
tell objSelectFrame
set strContents to contents as text
end tell
#####半角スペースを
set AppleScript's text item delimiters to " "
set listContents to every text item of strContents
#####改行に置き換え
set AppleScript's text item delimiters to "\n"
set strContents to (listContents) as text
tell objSelectFrame
set contents to strContents as text
end tell
set AppleScript's text item delimiters to ""
###お約束の再描画
redraw
end repeat

end tell
###お約束の再描画
redraw
end tell

|

[Illustrator]アイテムに名前をつける(連番)

[Illustrator]アイテムに名前をつける(レイヤ毎)
https://quicktimer.cocolog-nifty.com/icefloe/2022/04/post-285072.htmlこちらの
『連番』命名版↑こちらのはレイヤ毎連番

ダウンロード - e382aae38395e38299e382b7e38299e382a7e382afe38388e5908de4bb98e4b88ee980a3e795aa.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

####################################
####ドキュメントのカラースペース
tell application "Adobe Illustrator"
tell the current document
set strColorSpace to color space
end tell
end tell
####################################
####パスアイテムに名称を付与する
tell application "Adobe Illustrator"
###ドキュメントの名前
name of every document
###ドキュメントの場所
file path of every document
###全面の処理するファイルを定義
set activDoc to current document
##############################パスアイテム
tell activDoc
###レイヤをリストにして
set listLayer to every layer
###各レイヤ毎に処理
repeat with objLayer in listLayer
tell objLayer
set numLayerID to index as number
if numLayerID < 10 then
set numLayerID to ("00" & numLayerID) as text
set numLayerID to text -2 through -1 of numLayerID as text
end if
######レイヤ名は上下関係によってindexは随時変わります
######そのためレイヤ名の命名は最後がよろしいです
###set name to "Layer" & numLayerID & ""
end tell
end repeat
end tell
##############################
tell activDoc
set listEveryPageItem to every page item as list

set numCntEveryPageItem to (count of listEveryPageItem) as number
set numIndex to 0 as number
repeat with objPageItem in listEveryPageItem
set numIndex to numIndex + 1 as number
set objClass to class of objPageItem

if objClass is text frame then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("TextFrame" & numIndex) as text
end tell
else if objClass is path item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PathItem" & numIndex) as text
end tell
else if objClass is placed item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PlacedItem" & numIndex) as text
end tell
else if objClass is raster item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("RasterItem" & numIndex) as text
end tell
else if objClass is plugin item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PluginItem" & numIndex) as text
end tell
else if objClass is mesh item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("MeshItem" & numIndex) as text
end tell
else if objClass is compound path item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("CompoundItem" & numIndex) as text
end tell
else if objClass is embedded item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("EmbeddedItem" & numIndex) as text
end tell
else if objClass is graph item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GraphItem" & numIndex) as text
end tell
else if objClass is grid repeat item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GridRepeatItem" & numIndex) as text
end tell
else if objClass is group item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GroupItem" & numIndex) as text
end tell
else if objClass is legacy text item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("LegacyTextItem" & numIndex) as text
end tell
else if objClass is non native item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("NonNativeItem" & numIndex) as text
end tell
else if objClass is radial repeat item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("RadialRepeatItem" & numIndex) as text
end tell
else if objClass is symbol item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("SymbolItem" & numIndex) as text
end tell
else if objClass is symmetry repeat item then
tell objPageItem
##set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("SymmetryRepeatItem" & numIndex) as text
end tell

end if

log listEveryPageItem

end repeat
end tell
end tell

|

[Illustrator]アイテムに名前をつける(レイヤ毎)

レイヤ番号(index)は上下関係に依存して、変更されますが
他のアイテムはレイヤ毎番号になります。
_20220425_20_21_25_20220425_20_21_37

[Illustrator]アイテムに名前をつける(連番)もあります
https://quicktimer.cocolog-nifty.com/icefloe/2022/04/post-aee426.html
↑こちらは全てのページアイテムで連番となります。


ダウンロード - e382aae38395e38299e382b7e38299e382a7e382afe38388e5908de38292e4bb98e4b88ee38199e3828b.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

####################################
####ドキュメントのカラースペース
tell application "Adobe Illustrator"
tell the current document
set strColorSpace to color space
end tell
end tell
####################################
####パスアイテムに名称を付与する
tell application "Adobe Illustrator"
###ドキュメントの名前
name of every document
###ドキュメントの場所
file path of every document
###全面の処理するファイルを定義
set activDoc to current document
##############################パスアイテム
tell activDoc
###レイヤをリストにして
set listLayer to every layer
###各レイヤ毎に処理
repeat with objLayer in listLayer
tell objLayer
set numLayerID to index as number
if numLayerID < 10 then
set numLayerID to ("00" & numLayerID) as text
set numLayerID to text -2 through -1 of numLayerID as text
end if
######レイヤ名は上下関係によってindexは随時変わります
######そのためレイヤ名の命名は最後がよろしいです
###set name to "Layer" & numLayerID & ""
end tell
end repeat
end tell
##############################
tell activDoc
set listEveryPageItem to every page item as list
repeat with objPageItem in listEveryPageItem

set objClass to class of objPageItem

if objClass is text frame then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("TextFrame" & numIndex) as text
end tell
else if objClass is path item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PathItem" & numIndex) as text
end tell
else if objClass is placed item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PlacedItem" & numIndex) as text
end tell
else if objClass is raster item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("RasterItem" & numIndex) as text
end tell
else if objClass is plugin item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("PluginItem" & numIndex) as text
end tell
else if objClass is mesh item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("MeshItem" & numIndex) as text
end tell
else if objClass is compound path item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("CompoundItem" & numIndex) as text
end tell
else if objClass is embedded item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("EmbeddedItem" & numIndex) as text
end tell
else if objClass is graph item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GraphItem" & numIndex) as text
end tell
else if objClass is grid repeat item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GridRepeatItem" & numIndex) as text
end tell
else if objClass is group item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("GroupItem" & numIndex) as text
end tell
else if objClass is legacy text item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("LegacyTextItem" & numIndex) as text
end tell
else if objClass is non native item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("NonNativeItem" & numIndex) as text
end tell
else if objClass is radial repeat item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("RadialRepeatItem" & numIndex) as text
end tell
else if objClass is symbol item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("SymbolItem" & numIndex) as text
end tell
else if objClass is symmetry repeat item then
tell objPageItem
set numIndex to index as number
if numIndex < 10 then
set numIndex to ("00" & numIndex) as text
set numIndex to text -2 through -1 of numIndex as text
end if
set name to ("SymmetryRepeatItem" & numIndex) as text
end tell

end if

log listEveryPageItem

end repeat
end tell
end tell

|

[AppleScript]テキストのフォント名を付与する(ファミリ名+スタイル)

[AppleScript]テキストのフォント名を付与するの改良版
実際に付与するテキストの内容を『ファミリー名』+『スタイル名』にした

ダウンロード - e38395e382a9e383b3e38388e5908de4bb98e4b88er2.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


####################################
####
tell application "Adobe Illustrator"
###全面の処理するファイルを定義
set activDoc to current document
##############################
###各値をリストに格納するための初期化
set listTextFramePos to {} as list
set listOrgWidth to {} as list
set listOrgFontName to {} as list
set listOrgFontFamilyName to {} as list
set listOrgFontStyleName to {} as list
set listOrgFontSize to {} as list
###全面のドキュメント
tell activDoc
###選択中のテキストをリストに
set listSelectFrame to every text frame whose selected is true
###繰り返しの初期化
set numFontNameFrameNo to 1
####選択中のテキスト分繰り返す
repeat with objSelectFrame in listSelectFrame
tell item numFontNameFrameNo of listSelectFrame
##場所
set objOrgPos to position
copy objOrgPos to the end of listTextFramePos
##
set numOrgWidth to width
copy numOrgWidth to the end of listOrgWidth
get character 1
##フォント名
set strOrgFontName to name of text font of character 1 as text
copy strOrgFontName to the end of listOrgFontName
##ファミリ名
set strOrgFontFamilyName to family of text font of character 1 as text
copy strOrgFontFamilyName to the end of listOrgFontFamilyName
##スタイル
set strOrgFontStyleName to style of text font of character 1 as text
copy strOrgFontStyleName to the end of listOrgFontStyleName
##サイズ
set numOrgFontSize to size of character 1 as integer
copy numOrgFontSize to the end of listOrgFontSize
end tell
set numFontNameFrameNo to numFontNameFrameNo + 1
end repeat
#####↑でリストになった各種値で
#####↓テキストを新規作成します
set numFontNameFrameNo to 1
repeat with objSelectFrame in listSelectFrame
###ポジション取得
set objOrgPos to item numFontNameFrameNo of listTextFramePos
###幅取得
set numOrgWidth to item numFontNameFrameNo of listOrgWidth
###フォント名取得
set strOrgFontName to item numFontNameFrameNo of listOrgFontName
###ファミリ名
set strOrgFontFamilyName to item numFontNameFrameNo of listOrgFontFamilyName
###スタイル
set strOrgFontStyleName to item numFontNameFrameNo of listOrgFontStyleName
####フォントサイズ取得
set numOrgFontSize to item numFontNameFrameNo of listOrgFontSize
###ポジションをXYにバラす
set numOrgPosX to item 1 of objOrgPos as number
set numOrgPosy to item 2 of objOrgPos as number
set numDistPosX to numOrgPosX as number
###新規テキスト用にフォントサイズ分上部に新規ポジションにする
set numDistPosy to numOrgPosy + numOrgFontSize as number
###テキストフレームの名前を作っておく
set strFontNameFrame to ("FontName" & strOrgFontName & "") as text
###追加する文字列=フォントファミリー名+スタイル
##PostScript名の場合はこちらを
##set strIndexFontName to ("" & strOrgFontName & "") as text
set strIndexFontName to ("" & strOrgFontFamilyName & " " & strOrgFontStyleName & "") as text
###テキストを作成する
set objFontName to make new text frame with properties {kind:point text, name:strFontNameFrame, contents:strIndexFontName, position:{numDistPosX, numDistPosy}}
###出来上がったテキストについて
tell objFontName
####フォントサイズは元のサイズの半分
set numFontNameFontSize to numOrgFontSize / 2 as integer
###文字数数えて
set numCntChr to count of character
set numCheChrNo to 1
###全ての文字のサイズを変更する
repeat numCntChr times
set size of character numCheChrNo to numFontNameFontSize
set numCheChrNo to numCheChrNo + 1
end repeat
end tell
set numFontNameFrameNo to numFontNameFrameNo + 1
end repeat
###お約束の再描画
redraw
end tell
end tell

|

[Illustrator]アートボードの名前を連番に

アートボードのname属性はApplescriptで«class bAl9»の不具合があるので
javascriptを利用して変更します。

ダウンロード - e382a2e383bce38388e3839be38299e383bce38388e38299e381aee5908de5898d.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

####設定項目
##アートボード番号の前
set strNoBefore to ""
##アートボード番号の後
set strNoAfter to ""

####################################
####ドキュメントのカラースペース
tell application "Adobe Illustrator"
tell the current document
set strColorSpace to color space
end tell
end tell
####################################
####パスアイテムに名称を付与する
tell application "Adobe Illustrator"
###全面の処理するファイルを定義
set activDoc to current document
##############################artboards
###アートボードの名前は取り出せない
####実行前に name を «class bAl9» に設定する必要がある
####このバグを回避するためにアートボードの名前はJavascriptsを使う
tell activDoc
###アートボードの数を数える
set numCntArtBoard to count of every artboard
###前面のドキュメント
do javascript "var objActivDoc=app.activeDocument;"
###アートボードの数
do javascript "var numCntArtBoard =objActivDoc.artboards.length;"
set numCntArtBoard to do javascript "objActivDoc.artboards.length;"
###Javascript用の初期値
set numArtboardNo to 0 as number
###各アートボード毎に処理
repeat numCntArtBoard times
###アートボード番号が10より少ない場合はゼロサプレスする
set strDistArtBroadNo to numArtboardNo + 1
if strDistArtBroadNo < 10 then
set strZeroAdd to ("00" & strDistArtBroadNo) as text
set strDistArtBroadNo to text -2 through -1 of strZeroAdd as text
end if
###アートボードの名前を定義
set artBordName to ("" & strNoBefore & strDistArtBroadNo & strNoAfter & "") as text
##set artBordName to ("アートボード:" & strDistArtBroadNo & "") as text
###アートボードの名前を取得しておいて動作チェック
do javascript "var strArtBoardName=objActivDoc.artboards[" & numArtboardNo & "].name;"
set strArtBoardName to do javascript "objActivDoc.artboards[" & numArtboardNo & "].name;"
###アートボードの名前を変更
do javascript "objActivDoc.artboards[" & numArtboardNo & "].name=\"" & artBordName & "\""
###アートボード番号のカウントアップ
set numArtboardNo to numArtboardNo + 1 as number
end repeat
end tell
###お約束の再描画
redraw
end tell

|

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat Dialog Acrobat Form Acrobat JS Acrobat Open Acrobat Plugin Acrobat python Acrobat Reader Acrobat Sequ Acrobat Stamps Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin System Information Admin Tools Admin Users Admin Volumes Adobe Apple AppleScript AppleScript Guide AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Automator AppleScript AVAsset AppleScript AVconvert AppleScript AVFoundation AppleScript AVURLAsset AppleScript BackUp AppleScript Barcode AppleScript Bash AppleScript Basic AppleScript Basic Path AppleScript Bluetooth AppleScript BOX AppleScript Browser AppleScript Calendar AppleScript CD/DVD AppleScript Choose AppleScript Chrome AppleScript CIImage AppleScript CloudStorage AppleScript Color AppleScript com.apple.LaunchServices.OpenWith AppleScript Console AppleScript Contacts AppleScript CotEditor AppleScript CURL AppleScript current application AppleScript Date&Time AppleScript delimiters AppleScript Desktop AppleScript Device AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript eMail AppleScript Encode Decode AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript HTML AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim Applescript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mobileconfig AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSBitmapImageRep AppleScript NSBundle AppleScript NSCFBoolean AppleScript NSCharacterSet AppleScript NSColor AppleScript NSColorList AppleScript NSData AppleScript NSDictionary AppleScript NSError AppleScript NSEvent AppleScript NSFileAttributes AppleScript NSFileManager AppleScript NSFont AppleScript NSFontManager AppleScript NSImage AppleScript NSIndex AppleScript NSKeyedArchiver AppleScript NSKeyedUnarchiver AppleScript NSLocale AppleScript NSMutableArray AppleScript NSMutableDictionary AppleScript NSMutableString AppleScript NSNotFound AppleScript NSNumber AppleScript NSOpenPanel AppleScript NSPasteboard AppleScript NSPDFImageRep AppleScript NSpoint AppleScript NSPredicate AppleScript NSRange AppleScript NSRegularExpression AppleScript NSRunningApplication AppleScript NSScreen AppleScript NSSize AppleScript NSString AppleScript NSStringCompareOptions AppleScript NSTask AppleScript NSTimeZone AppleScript NSURL AppleScript NSURL File AppleScript NSURLBookmark AppleScript NSURLComponents AppleScript NSURLResourceKey AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photos AppleScript Photoshop AppleScript Plist System Events AppleScript PostScript AppleScript prefPane AppleScript Preview AppleScript Python AppleScript QR AppleScript QR Decode AppleScript QuickLook AppleScript QuickTime AppleScript record AppleScript Regular Expression AppleScript Reminders AppleScript ReName AppleScript Repeat AppleScript RTF AppleScript Safari AppleScript SaveFile AppleScript ScreenCapture AppleScript ScreenSaver AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript Sort AppleScript Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript System Events AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text TSV AppleScript TextEdit AppleScript Translate AppleScript Trash AppleScript Twitter AppleScript UI AppleScript Unit Conversion AppleScript UTType AppleScript valueForKeyPath AppleScript Video AppleScript VisionKit AppleScript Visual Studio Code AppleScript webarchive AppleScript webp AppleScript Wifi AppleScript XML AppleScript XML EPUB AppleScript XML OPML AppleScript XML Plist AppleScript XML RSS AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript YouTube AppleScript Zero Suppress Applications Barcode OnLine Tools CityCode Design iPhone List Logs lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom zoom