Highlighted

I'm running extendscript in command line and get an alert.

Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

../ExtendScript Toolkit.exe" -run exampleScript.jsx

Does anybody know how can I disable this ? or is there any good way to run the extendscript in non interactive mode.

TOPICS
Scripting

Views

1.4K

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

I'm running extendscript in command line and get an alert.

Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

../ExtendScript Toolkit.exe" -run exampleScript.jsx

Does anybody know how can I disable this ? or is there any good way to run the extendscript in non interactive mode.

TOPICS
Scripting

Views

1.4K

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
Jan 17, 2019 0
Advocate ,
Jan 18, 2019

Copy link to clipboard

Copied

Hello Jacob,

There are several ways to fire an extendscript in FrameMaker without having to call it explicitly from the commandline.

1. Create a command and add it to one of the menus.

2. Create an event handler that fires when a particular event happens (e.g. PreFileOpen or PostSaveXml)

3. Create a script that is executed automatically whenever FrameMaker starts.

Usually, it is a combination of these that you would need. If you explain what you need we may be able to help.

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...
Jan 18, 2019 0
Community Beginner ,
Jan 18, 2019

Copy link to clipboard

Copied

I run extend script in command line:

../ExtendScript Toolkit.exe" -run exampleScript.jsx

it works okay but I don't want to press yes each time to avoid the alert.

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...
Jan 18, 2019 0
Advocate ,
Jan 18, 2019

Copy link to clipboard

Copied

Then you need to create a command for it and add it to one of the menus - or create your own menu. Then the command will be run from within FrameMaker instead of outside - which may be seen as a malicious attack. If the alert would not show, a mail attachment could automatically fire a script and do something disruptive.

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...
Jan 18, 2019 0
Community Beginner ,
Jan 18, 2019

Copy link to clipboard

Copied

Seems, I managed to overcome the problem moving the script to the /Adobe Scripts/

When I run .jsxbin I don't see any alert but it doesn't open book/files

btw, do you know how to pass arguments on command line something like the following:

../ExtendScript Toolkit.exe" -run exampleScript.jsx arg1 arg2

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...
Jan 18, 2019 0
Advocate ,
Jan 18, 2019

Copy link to clipboard

Copied

If your script uses relative paths it will be relative to the location of the script. That might cause some file related commands to fail - try adding an Err(   ) to make the full name of the book or file to be opened in the console.

As for command line arguments - I have never tried that. You may find information by searching for the $ object. That is a generic Javascript construct pointing to the current script. This is also where you find the path name of the currently executed script, so there might be properties or methods for arguments as well.

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...
Jan 18, 2019 0
Community Beginner ,
Jan 18, 2019

Copy link to clipboard

Copied

So, you mean that this might be wrong ?

var doc = OpenFile ('C:\\Users\\user\\Desktop\\test\\test.book')

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...
Jan 18, 2019 0
Advocate ,
Jan 18, 2019

Copy link to clipboard

Copied

OpenFile is not a function I recognize. To open a FM book or file, you need the much more elaborate Open(  ) function, for which you need to define a set of propVals and provide an array of propVals for the method to report back properties when the Open failed. Check the Scripting Guide for the global Open(  ) function.

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...
Jan 18, 2019 0
Community Beginner ,
Jan 18, 2019

Copy link to clipboard

Copied

it is my function to which i give path of the book.  I'm wondering if the path 'C:\\Users\\user\\Desktop\\test\\test.book' is wrong

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...
Jan 18, 2019 0
Advocate ,
Jan 18, 2019

Copy link to clipboard

Copied

Seems to be fine with the ecaped backslashes. First thing to do is insert a bunch of Err( ) commands to your code, so that you can read what the various parameters are in the console. After a critical command, such as Open( ) on the book, print the FA_errno to the console with some text indicating where the code is. If FA_Errno is 0, everthing is OK If not, you need to chedk the scripting guide for the meaning of the error code. Do this immediately after the critical function call, as FA_errno gets overwritten by subsequent calls.

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...
Jan 18, 2019 0