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

app.open() details

Contributor ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

Hi,

 

is there any documentation on the "options" parameter. It is described as "anything"...

TOPICS
Scripting

Views

95

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
community guidelines
Advisor ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

It's an OpenOptions() object you can create. 

 

femkeblanco_0-1663864341903.png

 

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
community guidelines
Contributor ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

Many thanks - unfortunately the feature I was looking for is not among the options. I hoped to find a way to set the ruler 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
community guidelines
Community Expert ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

IMHO (and unforturnately) the ruler units cannot be set for existing documents.

 

I have seen scripts that are supposed to make this possible, but they did not work for me. (For new documents, however, it is possible).

 

Existing open documents could be set (as a workaround) with a series of key combinations (preferences press [Ctrl]+[K] -> click on Units tab -> press [Tab] three times and then -> cursor up or down (several times). Maybe this will help you a little bit.

 

But maybe someone knows a script that works.

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
community guidelines
Contributor ,
Sep 23, 2022 Sep 23, 2022

Copy link to clipboard

Copied

Hi,

thank you for the hint, but I really need script access.

I had a look at the SDK, but there setting ruler units is also described as "only while reading the file"

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
community guidelines
Advisor ,
Sep 23, 2022 Sep 23, 2022

Copy link to clipboard

Copied

LATEST

Here's a Windows-based implementation of @pixxxelschubser's suggestion, which can change an existing document's units between inches, millimeters and centimeters. 

var units = "i";  // inches
// var units = "m";  // millimeters
// var units = "c";  // centimeters
var temp;
{
    interactWithDialog();
    app.executeMenuCommand("unitundoPref");
}
function interactWithDialog() {
    var contents = 
        'Set WshShell = WScript.CreateObject("WScript.Shell")\n' + 
        'WshShell.SendKeys "' + units + '"\n' + 
        'WshShell.SendKeys "{ENTER}"\n';
    temp = new File("~/Desktop/temp.vbs");
    temp.open("w");
    temp.write(contents);
    temp.close();
    temp.execute();
}
temp.remove();

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
community guidelines