Skip to main content
Participating Frequently
October 31, 2024
Question

Setting Different Measurement Units for Scripts on InDesign Server

  • October 31, 2024
  • 2 replies
  • 752 views

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>

This topic has been closed for replies.

2 replies

leo.r
Community Expert
Community Expert
October 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.

Participating Frequently
November 1, 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?
Community Expert
November 2, 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.


@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 )

Participating Frequently
October 31, 2024

Sure, both users can run the scripts simultaneously

Robert at ID-Tasker
Legend
October 31, 2024

Are you replying to yourself? 

 

Participating Frequently
October 31, 2024

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