表のスクリプトについて

[10448]表のスクリプトについて 投稿者:mi 投稿日:2006/12/20(Wed) 12:08
お世話になっております。
以前こちらにて、InDesign2.0.1で使用する、表のアキを0にするスクリプトを教えていただいたのですが、
OS10.4.8、InDesignCS2で使用するにあたり同じのを使いたいのですが…

以前教えていただいたもの
-----------------------------------
tell application "InDesign 2.0.1J"
activate
set MyDocument to active document
set mywindow to active window

set myspread to active spread of mywindow
set MyItem to all page items of properties of myspread

set SelectProp to object reference of selection

set properties of SelectProp to {top inset:0}
set properties of SelectProp to {right inset:0}
set properties of SelectProp to {left inset:0}
set properties of SelectProp to {bottom inset:0}

end tell
-----------------------------------

これなのですが、 "InDesign 2.0.1J"というのを
"Adobe InDesign CS2_J"にしたのですがうまくいきません;
どこか違う所も変更しなければいけないのでしょうか。
お手数ですが教えてください。
よろしくお願いします。
» 1
[10448へのレス]Re: 表のスクリプトについて 投稿者:小泉 投稿日:2006/12/20(Wed) 13:28
tell application "Adobe InDesign CS2_J"
activate
set MyDocument to active document
set mywindow to active window

set myspread to active spread of mywindow
set MyItem to all page items of properties of myspread

set SelectProp to object reference of selection

set properties of cells of SelectProp to {top inset:0}
set properties of cells of SelectProp to {right inset:0}
set properties of cells of SelectProp to {left inset:0}
set properties of cells of SelectProp to {bottom inset:0}

end tell
---
cells of  を入れるといけますね。

1行で書くと
tell document 1 of application "Adobe InDesign CS2_J" to set properties of cells of selection to {top inset:0, right inset:0, left inset:0, bottom inset:0}
» 2
[10448へのレス]Re: 表のスクリプトについて 投稿者:mi 投稿日:2006/12/20(Wed) 15:24
>小泉様

できました!ありがとうございます。
大変助かりました。

1行にまとめて書くこともできるのですね。
勉強になりました。
他のスクリプトも修正して使いたいと思います。
» 3
[10448へのレス]Re: 表のスクリプトについて 投稿者:小泉 投稿日:2006/12/21(Thu) 20:27
1行にするのはちょっとあれですが、今回のスクリプトに関して言えば
3~6行目は無くてもいいです。
スクリプトパレットから使うことを考えるとactivateもいりません。

命令部分も1行スクリプトのようにまとめられるし、
大量に処理する場合まとめた方が速く処理してくれます。

まとめたは、場合7行目のSelectProp取得も必要なくなるので、
普通に書くのなら
tell document 1 of application "Adobe InDesign CS2_J"
set properties of cells of selection to {top inset:0, right inset:0, left inset:0, bottom inset:0}
end tell
で3行ですね。

長文失礼。
» 4
[10448へのレス]Re: 表のスクリプトについて 投稿者:mi 投稿日:2006/12/26(Tue) 15:00
>小泉様

お返事が遅れて申し訳ありません。
3行のを基準に、他のスクリプトも修正してみました。
確かに、処理が早くなりました!
ありがとうございました。
この記事の書き込み元へのリンク (コメントや質問などはこちらへどうぞ)

このページをシェア