app.activeDocument.viewPreferences.horizontalMeasurementUnits =
MeasurementUnits.millimeters;
app.activeDocument.viewPreferences.verticalMeasurementUnits =
MeasurementUnits.millimeters;
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
app.activeDocument.zeroPoint = ;
var myDoc = app.activeDocument;
var xAxis, yAxis, pageNo;
function cmyk(t, c, m, y, k) {
return function() {
var myColor;
myColor = app.activeDocument.colors.item(t);
if(!myColor || !myColor.isValid) {
myColor = app.activeDocument.colors.add();
myColor.properties = {name:t, model: ColorModel.PROCESS, space:
ColorSpace.CMYK ,colorValue: };
} else {
if(c != undefined && (myColor.properties.colorValue[0] != c ||
myColor.properties.colorValue[1] != m || myColor.properties.colorValue[2]
!= y || myColor.properties.colorValue[3] !=k)) {
myColor.properties.space = ColorSpace.CMYK;
myColor.colorValue = ;
// alert("Renk \""t"\" değiştirildi. C = "+ c + " ; M = "
+ m + " ; Y = "+ y + " ; K = " + k );
}
}
return myColor;
};
}
var diyalogWindow = app.dialogs.add();
with(diyalogWindow){
with(dialogColumns.add()){
with(borderPanels.add()){
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Find W"});
findW = textEditboxes.add();
}
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Change W"});
changeX = textEditboxes.add();
}
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Move X"});
moveX = textEditboxes.add();
}
}
with(borderPanels.add()){
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Find H"});
findH = textEditboxes.add();
}
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Change H"});
changeY = textEditboxes.add();
}
with(dialogColumns.add()) {
staticTexts.add({staticLabel:"Move Y"});
moveY = textEditboxes.add();
}
}
}
}
if(diyalogWindow.show() == 1)
{
var j;
for (var p = 0; p < app.activeDocument.allPageItems.length; p++)
{
var pageItem = document.allPageItems[p];
pageItem.select();
var frameSize = pageItem.geometricBounds;
var frameWidth = frameSize[3]-frameSize[1];
var frameHeight = frameSize[2]-frameSize[0];
if(Number(Math.round(frameWidth)) == findW.editContents &&
Number(Math.round(frameHeight)) == findH.editContents)
{
pageItem.geometricBounds = [frameSize[0], frameSize[1],
frameSize[0] - Number(changeY.editContents), frameSize[1] +
Number(changeX.editContents)];
pageItem.move();
for(j = 0; j < pageItem.paragraphs.length; ++j) {
pageItem.paragraphs[j].fillColor = cmyk("TEST", 100, 0,
0, 0)();
pageItem.paragraphs[j].appliedFont = "Swis721 Cn BT";
pageItem.paragraphs[j].justification =
Justification.RIGHT_ALIGN;
//?
//?
//?
//?
//?
}
}
}
}
alert("Done!!!");
/*
this here
//?
//? join fontsize
//? join all large letters or all lowercase letters
//? join bold and italic
//? join fill color Textbox
*/
2014-09-10 11:33 GMT+03:00 <forums_noreply@adobe.com>:
this script adding (here // ?) created by
<https://forums.adobe.com/people/%5BJongware%5D> in InDesign Scripting
- View the full discussion
<>