Copy link to clipboard
Copied
Hi,
is there any documentation on the "options" parameter. It is described as "anything"...
Copy link to clipboard
Copied
It's an OpenOptions() object you can create.
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
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.
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"
Copy link to clipboard
Copied
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();