Skip to main content
matthieu_8244
Participant
March 16, 2026

Behavioral differences between MacOS versions for a resizing script (Illustrator 30.2.1)

  • March 16, 2026
  • 2 replies
  • 31 views

Hello,

I have an extendscript that imports a file and resizes that import based on the value in /tmp/valeurTauxReduc.txt (for example 80)

app.executeMenuCommand('preview');
var docRef = activeDocument;
var lireTauxReduc = new File ("/tmp/valeurTauxReduc.txt");
lireTauxReduc.encoding = "UTF8";
lireTauxReduc.lineFeed = "unix";
lireTauxReduc.open("r");
var resultlireTauxReduc = lireTauxReduc.readln();
numbReduc = parseInt(resultlireTauxReduc);
redraw();

var saveFileTempo = new File("path/to/file.pdf");
fichierPdf.copy(saveFileTempo);
docRef.placedItems[0].relink(saveFileTempo); // Importe le fichier
// Incorporer l'image importée
docRef.placedItems[0].embed();
// Mise à l'échelle du décor uniquement
if (lireTauxReduc.exists == true){
docRef.groupItems[0].resize(numbReduc, numbReduc, true, false, false, false, 100, Transformation.CENTER);
}
redraw();

It works flawlessly on my Mac (Sonoma 14.6.1) but for some reason doesn’t do the resize() on a more recent one (Tahoe 26.3.1).
I’ve tried debuging it in many ways (alerts, try-catches, using the debug extension for vs code) but to no avail, the script does the resize but the items are not resized.

My last attempt was to create a cube and resize it which works on both computers

// Créer un cube rouge et le redimensionner à 50%
var redCubeLayer = docRef.layers.add();
redCubeLayer.name = "RedCube";
var cubeSize = 100; // Taille du cube en points
var redCube = redCubeLayer.pathItems.rectangle(0, 0, cubeSize, cubeSize);
var redColor = new CMYKColor();
redColor.cyan = 0;
redColor.magenta = 100;
redColor.yellow = 100;
redColor.black = 0;
redCube.filled = true;
redCube.fillColor = redColor;
redCube.stroked = false;
// Redimensionner le cube à 50%
redCube.resize(80, 80, true, false, false, false, 100, Transformation.CENTER);
redraw();

Even with this discovery i have yet to grasp the answer thus why I am turning to the community for enlightenment
 

    This topic has been closed for replies.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    March 16, 2026

    This question is unrelated to Using this Community

    It belongs in the Illustrator forum below where the experts there will see it.

    https://community.adobe.com/questions-652

     

    Good luck.

     

     

     

    Nancy O'Shea— Product User & Community Expert
    John T Smith
    Community Expert
    Community Expert
    March 16, 2026

    Moving a message to the correct forum is not working
    This is the USING THE COMMUNITY forum... this is where the forum is discussed
    This is not where you ask program or account questions
    Start here https://community.adobe.com/community and find the correct forum for your question

    Make a small change in your question title so you don't receive a forum error