How to Create Guides from Selection ?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

jacks_bfa

How to Create Guides from Selection ?

Post by jacks_bfa »

Dear Friends,
How can we Create Guides from Selection using PS script or any other easy way ?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

txuku

How to Create Guides from Selection ?

Post by txuku »

Bonjour

Try this :

Code: Select all//GuidesSelection.jsx

var valSelection = new Array();
valSelection = activeDocument.selection.bounds;

activeDocument.guides.add (Direction.HORIZONTAL, UnitValue (valSelection[1]));
activeDocument.guides.add (Direction.HORIZONTAL, UnitValue (valSelection[3]));

activeDocument.guides.add (Direction.VERTICAL, UnitValue (valSelection[0]));
activeDocument.guides.add (Direction.VERTICAL, UnitValue (valSelection[2]));


//inutile
//app.activeDocument.guides.visible == true; // ne fonctionne pas !