Highlighted

Frame size changed when run script in other device, why?

Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

Hey everyone,

 

I've developed a function. Anyhow, the function on my device (Mac - Catalina) works smothely and when i run it on the designer devoce (Mac - Mohave) It raise an issue. Actully it's simple one, only the fitting differs from mine to his. The items on the document on my device looks good but on his looks very large! 

 

How can i solve the issue? and what could cause the issue? cause we doubled check the setting and we have the same sittings. 

 

Thanks all.

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

The view preferences probably differ on the other computer. Try this at the start and end of your code: 

 

 

//Start of script, after you've created the document. This assumes that has a variable called "doc"
var currViewPrefs = doc.viewPreferences.properties;
//or use whatever measurement units you want
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.INCHES;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.INCHES;

//end of script to reset preferences back to user settings
doc.viewPreferences.properties = currViewPrefs;

 

 

 

Topics

Activation billing and install, Bug, EPUB, Feature request, How to, Import and export, InCopy workflow, Performance, Print, Publish online, Scripting, SDK, Server developers, Sync and storage, Type

Views

50

Likes

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

Frame size changed when run script in other device, why?

Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

Hey everyone,

 

I've developed a function. Anyhow, the function on my device (Mac - Catalina) works smothely and when i run it on the designer devoce (Mac - Mohave) It raise an issue. Actully it's simple one, only the fitting differs from mine to his. The items on the document on my device looks good but on his looks very large! 

 

How can i solve the issue? and what could cause the issue? cause we doubled check the setting and we have the same sittings. 

 

Thanks all.

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

The view preferences probably differ on the other computer. Try this at the start and end of your code: 

 

 

//Start of script, after you've created the document. This assumes that has a variable called "doc"
var currViewPrefs = doc.viewPreferences.properties;
//or use whatever measurement units you want
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.INCHES;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.INCHES;

//end of script to reset preferences back to user settings
doc.viewPreferences.properties = currViewPrefs;

 

 

 

Topics

Activation billing and install, Bug, EPUB, Feature request, How to, Import and export, InCopy workflow, Performance, Print, Publish online, Scripting, SDK, Server developers, Sync and storage, Type

Views

51

Likes

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
Adobe Community Professional ,
Aug 17, 2020

Copy link to clipboard

Copied

Does your code set the view preferences measurement units?

Likes

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
Reply
Loading...
Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

Nope, it only creates the document and start to set the frames.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Aug 17, 2020

Copy link to clipboard

Copied

The view preferences probably differ on the other computer. Try this at the start and end of your code: 

 

 

//Start of script, after you've created the document. This assumes that has a variable called "doc"
var currViewPrefs = doc.viewPreferences.properties;
//or use whatever measurement units you want
doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.INCHES;
doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.INCHES;

//end of script to reset preferences back to user settings
doc.viewPreferences.properties = currViewPrefs;

 

 

 

Likes

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
Reply
Loading...
Adobe Community Professional ,
Aug 17, 2020

Copy link to clipboard

Copied

As Brian suggests, usually getting and setting the measurement units is the way to go. You can also set the bounds array as strings, and use a specific unit without setting the measurement units:

 

 

var mySelection = app.selection[0];
var gm = mySelection.geometricBounds

//bounds set to centimeters
mySelection.geometricBounds = ["1cm", "1cm", "5cm", "5cm"]

//or convert a number to string and then add the dimension unit in = inches
mySelection.geometricBounds = [gm[0], gm[1], (gm[0] + 2.125 ).toString() + " in", (gm[1] + 3.5).toString() + " in"];

 

 

Likes

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
Reply
Loading...
Participant ,
Aug 17, 2020

Copy link to clipboard

Copied

Thanks!

Likes

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
Reply
Loading...