Copy link to clipboard
Copied
Hi! Is there a way to enter a reference point by clicking with the mouse? For example: I want to move an object (while free transform is active). In the field ''set horizontal position of reference point'', I would like to click instead of dragging or entering a value by hand..(same for Y axis). This way I would not have to zoom out to get my object, place it approximately, then zoom in and move it to where i want it to be.
thanks you!
I would use javascript rather than VB, as more people know JS. As I mentioned earlier, I don't think you can run the script while you're transforming something, but you can do it afterwards. Here's a script that will move the current layer's top left corner to a color sample point.
#target photoshop
var doc = activeDocument;
var pt = doc.colorSamplers[0].position
var lBounds = doc.activeLayer.bounds
doc.activeLayer.translate (pt[0]-lBounds[0], pt[1]-lBounds[1]);
Moving thread to scripting forum.
Copy link to clipboard
Copied
You could do that with a script: set an eye dropper sample point as your reference point, then move the object, but I don't think it will work when free transform is active.
Copy link to clipboard
Copied
ok! I am currently trying to figure out how to make that script..I am not very experienced with VBS. My experience stops at making macro command for Autocad, which have very little variable to play with compare to scripting..I might try in the scripting forum to see if someone can help me with that..
thanks!
Copy link to clipboard
Copied
I would use javascript rather than VB, as more people know JS. As I mentioned earlier, I don't think you can run the script while you're transforming something, but you can do it afterwards. Here's a script that will move the current layer's top left corner to a color sample point.
#target photoshop
var doc = activeDocument;
var pt = doc.colorSamplers[0].position
var lBounds = doc.activeLayer.bounds
doc.activeLayer.translate (pt[0]-lBounds[0], pt[1]-lBounds[1]);
Moving thread to scripting forum.
Copy link to clipboard
Copied
I would recommend considering to use the Count Tool.
For many Photoshop users it is not very important anyway and one can use Script Events Manager to link a Script to the creation of a counter.
In this case I use two counters to define the direction, too.
Copy link to clipboard
Copied
Looks very nice! I will try to use your 2 point method to define the scale of the object..
Copy link to clipboard
Copied
Hi Chuck
Only one note: be sure that your ruler units are in pixels
Copy link to clipboard
Copied
Thank you Chuck, that is very useful and i will start with that to polish the script to my needs! It seems a bit simpler than I expected so I might actually spend more time on scripting my tools!