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

Reference Point Script

Enthusiast ,
Dec 27, 2023 Dec 27, 2023

Hello

 

I have a script which rotates an object (textframe) with object style "Signs" applied to it.

 

Script is working fine except that it requires Center point of the Proxy Refernce point to be activated. Therefore I would like incorporate that in the script itself. How do I do that ? 

I have attached a screenshot of what I want to set.

Thanks

TOPICS
How to , Scripting
1.1K
Translate
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 , Dec 27, 2023 Dec 27, 2023

Try this—sets the Transform panel ref pont for the front window (not the application):

 

 

app.windows[0].transformReferencePoint = AnchorPoint.TOP_RIGHT_ANCHOR

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#LayoutWindow.html#d1e57100

 

 

 

Translate
Community Expert ,
Dec 27, 2023 Dec 27, 2023

Hi @Bedazzled532, please have a look at my script answering this question. You can see that I do the rotation using a matrix, from AnchorPoint.centerAnchor, which is I think what you are asking. Let me know if I haven't understood correctly.

- Mark

Translate
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
Enthusiast ,
Dec 27, 2023 Dec 27, 2023

Hello @m1b

Thanks for the reply. What I want is bit different.

I want to set the point of my choice before rotation or moving or doing any kind of transformation. After I am done with it, I want to set it back to what it was.

I checked indesignjs.de site but I am not able to find the exact option where I can set that proxy.

Translate
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 ,
Dec 27, 2023 Dec 27, 2023

Hi @Bedazzled532, as far as I know, there is no property of page items for what you are talking about. What is your actual need? eg. do you want to rotate or scale a page item around a particular point? This is possible.

- Mark

Translate
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 ,
Dec 27, 2023 Dec 27, 2023

Try this—sets the Transform panel ref pont for the front window (not the application):

 

 

app.windows[0].transformReferencePoint = AnchorPoint.TOP_RIGHT_ANCHOR

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#LayoutWindow.html#d1e57100

 

 

 

Translate
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
Enthusiast ,
Dec 27, 2023 Dec 27, 2023

Thank you so much @rob day  This is exactly what I was looking for.

I would also like to thank @m1b for the efforts.

 

Is there a way to first save existing information and then change the reference point?

Thanks

Translate
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
Enthusiast ,
Dec 27, 2023 Dec 27, 2023

Ok I found a way to save it.

 

var myPoints = app.windows[0].transformReferencePoint;

app.windows[0].transformReferencePoint = AnchorPoint.CENTER_ANCHOR;

...... some code ......

app.windows[0].transformReferencePoint = myPoints; //to revert back

Translate
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
LEGEND ,
Dec 27, 2023 Dec 27, 2023

As a piece of advice - in this case, do not use "s" at the end of the variable name - it's a variable holding single value, not an array or collection.

 

Better yet - use much more descriptive name - like myTransfRefPt - or something like that. 

 

It will help you to better understand your code - after some time. Or when you share it with someone. 

 

"myPoints" suggests that it's an array or collection of Points.

 

Translate
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
Enthusiast ,
Dec 27, 2023 Dec 27, 2023
LATEST

@Robert at ID-Tasker Thanks for the suggestion. I will keep that in mind.

Translate
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
LEGEND ,
Dec 27, 2023 Dec 27, 2023

It can also be set for the Document. 

 

Translate
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