Skip navigation
Home/Support/

Forums

799 Views 5 Replies Latest reply: May 23, 2008 10:38 AM by (りょうすけ) RSS
User 13 posts since
Feb 26, 2008
Currently Being Moderated

May 21, 2008 7:35 PM

IllustratorVBの質問で恐縮ですが……

IllustratorSDKがないのでダメモトでこちらに書き込みさせていただきます。
IllustratorVBについての質問です。

Illustratorに画像が何点か貼り込まれていて、
選択している貼り込み画像のファイル名もしくはファイルパスを取得するVBを作りたいのですが、
オブジェクトライブラリにSelectionがあるのを確認して以下のように記述したのですが、

Set myIllustrator = CreateObject("Illustrator.Application.3")
MsgBox myIllustrator.ActiveDocument.Selection.File

「オブジェクトがありません」のエラーになってしまいます。

しかたなく以下のように記述するとファイルパスが取得できます。

Set myIllustrator = CreateObject("Illustrator.Application.3")
CNT = myIllustrator.ActiveDocument.PlacedItems.count
For i = 1 To CNT
if myIllustrator.ActiveDocument.PlacedItems(i).Selected = true then
MsgBox myIllustrator.ActiveDocument.PlacedItems(i).File
end if
Next

でもこのスクリプトはあまりにもひどすぎます。
もっとシンプルにファイル名もしくはファイルパスを取得するにはどのように記述すれば良いのでしょうか。
よろしくお願い致します。

More Like This

  • Retrieving data ...

Bookmarked By (0)