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

Setting Different Measurement Units for Scripts on InDesign Server

New Here ,
Oct 31, 2024 Oct 31, 2024

I'd like that scripts runned by one user, use Millimeters as measurement unit, yet the same scripts but for another user - points.
Is it possible ?

 

 

<Title renamed by MOD>

TOPICS
How to , Scripting , Sync and storage
766
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
New Here ,
Oct 31, 2024 Oct 31, 2024

Sure, both users can run the scripts simultaneously

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 ,
Oct 31, 2024 Oct 31, 2024

Are you replying to yourself? 

 

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
New Here ,
Oct 31, 2024 Oct 31, 2024

Sorry, it seems there is no button `Edit`, so my 2nd msg was just an update.

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 ,
Oct 31, 2024 Oct 31, 2024

yes, the script just has to check the user identity and then use the desired units. depending on your workflow, the script will check either user name or some other markers that identify the user under your particular setup.

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
New Here ,
Nov 01, 2024 Nov 01, 2024

Let me explain.

I'd like that the following  should be local to each script and not global for all scripts:
app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS;
app.documents.add();

Is it possible?
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 ,
Nov 01, 2024 Nov 01, 2024

@mikeb65293881

 

You can have startup scripts.

 

But Server version is more based on instances than users. 

 

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 ,
Nov 01, 2024 Nov 01, 2024

Hi @mikeb65293881 ,

will document.viewPreferences.measurementUnit work for your environment?

 

Regards,
Uwe Laubender
( Adobe Community Expert )

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
New Here ,
Nov 01, 2024 Nov 01, 2024

yes, it works, but what's about documents.add?
In my workflow few INDDs to be opened, updated, created resulted INDD and finally all docs to be closed.
Sometimes it takes up to few minutes to complete.
Now imagine that the other user runs the same script. All doc's indecies is just a mess. 
I need a way how to resolve the task.

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 ,
Nov 01, 2024 Nov 01, 2024

@mikeb65293881

 

Like I've said already - Start-up Scripts.

 

Or just execute some script before / right after opening 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
Community Expert ,
Nov 02, 2024 Nov 02, 2024

@mikeb65293881 said: "yes, it works, but what's about documents.add?"

 

Hi Mike,

hm. Will the code below work for you on InDesign Server ?

It does on InDesign Desktop:

var doc = app.documents.add
(
	{

		viewPreferences :
		{ 
			horizontalMeasurementUnits :  MeasurementUnits.PIXELS ,
			verticalMeasurementUnits : MeasurementUnits.PIXELS ,
			strokeMeasurementUnits : MeasurementUnits.MILLIMETERS

			// There are some more…
		}
	}
);

 

Regards,
Uwe Laubender
( Adobe Community Expert )

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
New Here ,
Nov 04, 2024 Nov 04, 2024
LATEST

Yes, thank you!

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