• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Insert Reference point with mouse click

Community Beginner ,
Apr 22, 2018 Apr 22, 2018

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!

TOPICS
Actions and scripting

Views

619

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 23, 2018 Apr 23, 2018

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.

Votes

Translate

Translate
Adobe
Community Expert ,
Apr 22, 2018 Apr 22, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2018 Apr 23, 2018

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2018 Apr 23, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2018 Apr 24, 2018

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.

fullColorBrushDabSimulationCountToolScr.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 24, 2018 Apr 24, 2018

Copy link to clipboard

Copied

LATEST

Looks very nice! I will try to use your 2 point method to define the scale of the object..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2018 Apr 24, 2018

Copy link to clipboard

Copied

Hi Chuck

Only one note: be sure that your ruler units are in pixels

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 24, 2018 Apr 24, 2018

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines