🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #8194

Re: CS2 AS Swap Images

#8194
From: Martin Fischer*
Date: Thu, 02 Nov 2006 14:55
49 lines
1735 bytes
Hi Iow,

in my collection I have found two scripts: one which swaps the selected frames of pictures and one which swaps the contents of the selected frames:

1. Swap rectangles

 
// swapRectangles.jsx 

var mySelection = app.selection  
if (mySelection.length == 2)  
{  
	var coords1 = mySelection[0].geometricBounds;  
	var coords2 = mySelection[1].geometricBounds;	  
	var diff = [0, 0];  
	diff[1] = coords1[0] - coords2[0];  
	diff[0] = coords1[1] - coords2[1];  
	mySelection[1].move(undefined, diff);  
	diff[0] = diff[0]*-1;  
	diff[1] = diff[1]*-1;  
	mySelection[0].move(undefined, diff);  
} 





2. Swap contents of rectangles

 
// swapRectanglesContents.jsx 

var mySelection = app.selection; 

if (mySelection.length == 2)  
{  
	var firstLink = mySelection[0].allGraphics[0].itemLink.filePath;  
	var secondLink = mySelection[1].allGraphics[0].itemLink.filePath;  
	mySelection[0].place(secondLink);  
	mySelection[1].place(firstLink);  
}  




The script above are JavaScripts.
Maybe they can be some help for your to create the AppleScripts.

Martin
Technical Details
Message-ID: <3bc2281b.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.isoc.lu!webcrossing
References: <3bc2281b.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5a437813a4a930e0
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Martin Fischer*" <martin.fischer@online.de>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: CS2 AS Swap Images
Message-ID: <3bc2281b.0@webcrossing.la2eafNXanI>
Date: Thu, 2 Nov 2006 06:55:28 -0800
References: <3bc2281b.-1@webcrossing.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit