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

Has anybody had any experience developing extendscripts for FrameMaker using chatgpt (or similar AI)

Community Expert ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

I have read that one can use AI for generating code, but I have next to none experience with coding. I am merely curious as whether anybody has tried this with FrameMaker?


Bjørn Smalbro - FrameMaker.dk

Views

155

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 ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

I have used ChatGPT for generating XSLT code, but not ExtendScript.

Votes

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 ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

There was a short discussion some time ago about generating a list of variables, so fiddled around with a prompt for that in ChatGPT. Doesn't seem to work though. And since I have no idea what I am doing, I can't trouble shoot it either. This is what it looks like:

 

var doc = app.ActiveDoc;
var variables = doc.GetVarFmtNames();
var varList = "";

for (var i = 0; i < variables.length; i++) {
varList += variables[i] + ": " + doc.GetNamedVarFmt(variables[i]).Contents + "\n";
}

alert(varList);


Bjørn Smalbro - FrameMaker.dk

Votes

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 ,
Jul 24, 2023 Jul 24, 2023

Copy link to clipboard

Copied

LATEST

When it comes to FrameMaker ExtendScript, AI is dumb. Here is a smart solution:

#target framemaker

var varFmtList, doc, varFmt;

varFmtList = [];

doc = app.ActiveDoc;

varFmt = doc.FirstVarFmtInDoc;
while (varFmt.ObjectValid () === 1) {
    varFmtList.push (varFmt.Name + ": " + varFmt.Fmt);
    varFmt = varFmt.NextVarFmtInDoc;
}

alert (varFmtList.join ("\r"));

Votes

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