Skip to main content
研藤2288657
Participating Frequently
January 12, 2021
Question

AppleScriptでフォントとの選択

  • January 12, 2021
  • 4 replies
  • 1532 views

25.1にアップデートしたら、

今まで通っていたapplescriptの

set text font of characters to text font "FutoGoB101Pro-Bold" of application "Adobe Illustrator"

の最初の"のところで 「end of lineなどがあるべきところですが"""が見つかりましたと。」

エラーが返されるようになった。

This topic has been closed for replies.

4 replies

Participating Frequently
January 16, 2021

少しわかりました。

「 text font 」を「 font 」にするとver25.1でもコンパイルできました。

 

set font of characters to font "FutoGoB101Pro-Bold" of application "Adobe Illustrator"

 

私が書いた to every font whose 〜 は必要なく、時間がかかりすぎますので、

これでいけば、ひとまず今回の件は今まで通りの構文で使えそうです。

ちなみにver25.1未満でコンパイルすると「 font 」は「 text font 」に自動で置き換わります。

研藤2288657
Participating Frequently
January 19, 2021

ありがとうございます。

repeat させるようなものではなかったので、 to every font whose 〜 でも font に変えるだけのものでも、そんなに時間差がなかったので、 to every font whose 〜 で行ってます。ただ、将来的に、 to every font whose 〜 別の問題引き起きそうでビクビクしています。

 

Participant
January 15, 2021

25.1はスクリプト関連の不具合が多そうです。

例えば以下のような単純なスタイル適用でエラーが発生します。(25.01では動作する)

tell application "Adobe Illustrator"
	tell document 1
		apply paragraph style paragraph style 1 to text of story of text frame 1
	end tell
end tell

処理内容はテキストフレーム1に標準段落スタイルを適用するというシンプルなものです。

困ったものですね。スクリプト機能全般において不具合修正が待たれます。

monokano
Community Expert
Community Expert
January 12, 2021
tell application "Adobe Illustrator"
	tell document 1
		set mySelObjList to selection
		repeat with mySelObj in mySelObjList
			if class of mySelObj is text frame then
				tell mySelObj
					set text font of characters to text font "FutoGoB101Pro-Bold" of application "Adobe Illustrator"
				end tell
			end if
		end repeat
	end tell
end tell

 

これで再現しました。2020ではOK、2021(v25.1.0)では構文エラー。

バグでしょうねぇ…。

「do javascript」にもバグがあるようですし、v25.1.0はAppleScript受難のバージョンかも。

https://community.adobe.com/t5/illustrator/applescript-do-javascript-command-no-longer-works-in-25-1/m-p/11737799?page=1&profile.language=en

Ten A
Community Expert
Community Expert
January 12, 2021

あらら?
わたしのところでは25.1.0で通っちゃいました…

なんだろう(^-^;

monokano
Community Expert
Community Expert
January 12, 2021

v25.1未満でコンパイルが通ったものは、v25.1でも通ってしまいますね。

 

  1. v25.1.0のみ起動
  2. スクリプトエディタを再起動
  3. スクリプトエディタの新規書類に(コンパイル済みのコードではなく)このページのコードをコピペ
  4. コンパイルボタンを押す

 

これで再現するはず。

 

Ten A
Community Expert
Community Expert
January 12, 2021

アプリケーションに添付されているサンプルを含め手持ちのASを検証してみましたが特に問題が出ませんでした。
アップデート時にスクリプトエンジン等に不具合が生じている可能性はありますが、スクリプト自体を見ないとなんとも言い難いところがあります。

研藤2288657
Participating Frequently
January 12, 2021

ありがとうございます。

スクリプトエディタでコンパイルできなくなったので???です。