Delete Empty Text Blocks
Zach Manring
zmanring at mdpennysaver.com
Sat Apr 12 06:49:01 CDT 2008
Ok I see what you mean, I could make it find it, then select it somehow and
at the end delete selection? Kinda like the clear pasteboard script. Alright
so how can I get the element info of the selected text flow that comes back
at 0. Using the text flow owner shape?
On 4/11/08 5:05 PM, "Steve Mills" <smills at multi-ad.com> wrote:
> On Apr 11, 2008, at 15:49:43, Zach Manring wrote:
>
>> tell application "MultiAd Creator Pro"
>> set textcount to number of text flow of document 1
>> repeat with i from 1 to textcount
>> select text flow i of document 1
>> set ztextcount to count every character of text flow i of
>> document 1
>> if ztextcount < 1 then
>> select text flow i of document 1
>>
>> -- after its selected then I don't how to select it as an element,
>> if I use
>> it as "I" then it deletes the wrong element.
>>
>> delete
>> end if
>> end repeat
>> end tell
>
>
> A text flow is the object that holds and flows the text. Selecting a
> text flow simply selects its text. The text is flowed through text
> blocks (or text paths, both of which are subclasses of text
> container). Text blocks/paths are owned by shapes. If you know the
> flow only flows through 1 block/shape, then you can use text flow's
> owner shape property to easily get the shape. If not, then you'll have
> to walk the list of text containers and get each text container's
> owner shape.
>
> You're going to run into problem though when you delete objects that
> you're iterating through. If you delete object 2, then object 3
> becomes object 2, and object 4 becomes object 3, so in the next
> iteration, i is incremented from 2 to 3, you'll skip what was object 3
> and is now object 2. If objects will be deleted in a loop, you either
> need to loop backwards (which should prevent most indices from
> changing) or build a list of objects to delete, then delete them in a
> separate loop outside of the current loop.
>
> _________________________________________________________
> Steve Mills Me: 952-401-6255
> Senior Software Architect MultiAd
> smills at multiad.com www.multi-ad.com
>
>
> _______________________________________________
> Creator mailing list
> Creator at wacondatrader.com
> http://wacondatrader.com/mailman/listinfo/creator
>
> To officially report a bug in Creator, go here:
> http://www.creatorsoftware.com/support/contact_us/report_a_problem/
>
> Searchable Archive: http://feick.webhop.net/lists/html/creatorlist/
>
> Multi-Ad's Creator website can be found at:
> http://www.creatorsoftware.com
More information about the Creator
mailing list