🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
4 messages
4 total messages Started by Bertus_Bolknak Tue, 10 Feb 2009 22:22
How to insert page item into text frame?
#1470
Author: Bertus_Bolknak
Date: Tue, 10 Feb 2009 22:22
15 lines
1156 bytes
Applescript, InDesign CS3

Hello,

On my page I am talking to a text frame.
I could easily enter text with the command set last insertion point to "a text". No problem, but:

Somewhere on my page I have also a page item (which is a small rectangle). I would like to insert (cut and paste or whatever) that small rectangle at the end of my text into my text frame (so that the small rectangle becomes part of the text just as if it was a character).

How can this be done with Applescript?

Hoping very much that someone can help me with example code.

Kind regards,
Bertus Bolknak.
Re: How to insert page item into text frame?
#1472
Author: Shane_Stanley
Date: Tue, 10 Feb 2009 22:56
7 lines
1535 bytes
You will have to cut and paste: set the selection to the frame, tell the app
to copy, set the selection to the insertion point where you want it to go,
and then tell the app to paste.

-- 
Shane Stanley <sstanley@myriad-com.com.au>
AppleScript Pro Florida, April 2009 <http://scriptingmatters.com/aspro>
Re: How to insert page item into text frame?
#1475
Author: Olav_Kvern
Date: Wed, 11 Feb 2009 06:08
14 lines
954 bytes
Hi Bertus,

Thanks Shane! You could also re-create the object at the insertion point--something like this:



--Given an insertion point "myInsertionPoint" and an existing 
--rectangle myRectangle... 
set myProperties to properties of myRectangle 
tell myInsertionPoint 
set myNewRectangle to make rectangle with properties myProperties 
end tell

Ole
Re: How to insert page item into text frame?
#1476
Author: Shane_Stanley
Date: Wed, 11 Feb 2009 06:33
19 lines
2077 bytes
On 11/2/09 5:08 PM, "Olav Kvern" <member@adobeforums.com> wrote:

> You could also re-create the object at the insertion point--something like
> this: 

That's true. The problem, though, is that it only replicates the direct
properties of the frame. All the properties that reference other settings
objects get ignored, so in practise it's either a risky procedure or
complicated, especially with text frames and properties like text frame
preferences.

Like you, I'm no fan of copy and paste for scripting, but until you can
convince someone to implement a suitable move command, it's probably the
easiest option here. On the plus side, on Macs at least it seems
surprisingly stable, and doesn't require InDesign to be frontmost.

-- 
Shane Stanley <sstanley@myriad-com.com.au>
AppleScript Pro Florida, April 2009 <http://scriptingmatters.com/aspro>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads