Adobe InDesign: SDK/Scripting Bugs and Features
137 results found
-
findColor() returns a number, it should return objects to which the colour was applied
Using the Colour tab in the Find/Change dialog you can search text and/or objects to which a certain colour was applied in the document. That works fine.
However, in a script, this call:
app.findColorPreferences.properties.findWhat =
app.documents[0].swatches.item ('red');
app.documents[0].findColor();returns the number of objects to which the swatch 'red' was applied. It should return the objects to whci the swatch was applied.
This makes the function entirely useless. Please fix this.
2 votes -
Moving Anchoring Text to Anchored Object Crashes InDesign
Given a Text instance (
source) that contains an anchored object (U+FFFC marker), the commandsource.move(…)crashes InDesign if the destination (TextFrame, Text, InsertionPoint…) is itself an anchored object (or inside it).Code:
// Tested in ID CS6 and CC
// (see animation)
const BEG = LocationOptions.AT_BEGINNING;
var TFS = app.activeDocument.textFrames;source = TFS.itemByName('source').texts[0]; // Text: contains the anchor
host = TFS.itemByName('host'); // TextFrame: 'host' frame
dest = host.textFrames.itemByName('dest'); // TextFrame: 'dest' framesource.move(BEG,dest); // --> ID crash
//source.move(BEG,host); // WOULD BE OK
//source.duplicate(BEG,dest); // WOULD BE OK2 votes -
hyphenationExceptions in Dictionary
Hi,
app.documents[0].hyphenationExceptions.itemByName("English: UK").name.
It returns,
English: USA.
2 votes -
Upgrade XSLT enginge
Please consider upgrading the underlying XSLT 1.0 engine to at least XSLT 2.0 (if not XSLT 3.0)! It’s a pain to be forced to transform before going into InDesign or to write clumsy (for nowadays) XSLT 1.0 code.
Thanks, Tobias
2 votes -
False state with app.gpuPerformancePreferences.enableGpuPerformance if no GPU available
Function GetEnableGPUPerformance() of interface IGPUPerformancePrefs of GetExecutionContextSession()->QueryWorkspace() returns true in case no GPU or a not supported GPU is installed on your macOS computer.
To reproduce launch InDesign CC 2018 or later with modifier keys command, option, control, and shift pressed and confirm resetting the preferences.
If you now check the setting either with some C++ code, or ExtendScript "app.gpuPerformancePreferences.enableGpuPerformance", in both cases the returned result is true , which is not the expected result.
When you now choose Preferences > GPU Performance the properties are shown deselected and disabled, which is correct. If you now click in "OK", the…
2 votes -
app.activeBook
When more than one book is open, selecting the book tab (when they're tabbed), doesn't work for app.currentBook in scripting. It's needed to click inside the book panel to have it targeted. Just the tab selected doesn't work.
2 votes -
Scripted iterative document open/close fails to close files
Note: my sample code is jsx, but the problem may not be limited to jsx. Change the filetype of my provided files from txt to jsx prior to using!
We have multiple products that sometimes show a problem with document.close() not actually closing the file, leading to incorrect functioning, memory bloat, slowdowns, and we believe some crashes. I provide a test script that takes a currently open document and iteratively copies it, opens the copy, then closes the copy -- after the loop is finished, the copy files are removed.
Important: If run from the ESTK or Scripts Panel, the…
2 votes -
La nueva versión indesign 2020 ya no tiene la opción de Flip page para flash.
La nueva versión indesign 2020 ya no tiene la opción de Flip page para flash.
2 votes -
Allow for control of undo tracking Re: Undo Set Scripting Tag
Currently the only way to manipulate the undo queue is to run a script with doScript and even then it's very limiting. With my current event listeners, the user clicks around a few times and the undo queue fills up with 'Undo Set Scripting Tag' and they are unable to undo simple changes without holding down CTRL+Z for a few seconds. I am unable to use doScript because I need to return values to my interface. I would like to suggest an option to temporarily suspend undo tracking during certain script actions. Some of my actions do not change the…
2 votes -
textStyleRange.convertToNote() becomes very confused.
I'll attach a self-contained script which first creates in order to demonstrate problems with textStyleRange.convertToNote(). The script creates a small document containing "b"s. These are marked with a smaller pointSize so that they form individual textStyleRanges. The script then converts these textStyleRanges into notes. Unfortunately, the script terminates with a message: "Object is invalid; tsr.convertToNote()". This message happens because the scripting engine has become confused and is trying to convert a "b" within a note into another note. This shouldn't happen and is the first problem.
Open the story window. The beginning of the story has a clear pattern of…
2 votes -
User Interaction Level resets during Data Merge
Using at the top of the InDesign tell block:
set user interaction level of script preferences to never interactThe way I understand user interaction levels, when set to 'never interact', it should suppress all dialog boxes from popping up.
When AppleScript performs 'merge records', and the merged record contains missing fonts, ONLY SOMETIMES a missing fonts dialog box pops up and breaks the script. One can close this dialog, run the script again, and the dialog doesn't appear. This unpredictability is why I'm logging it as a bug.
Looking at the JavaScript DOM, the userInteractionLevel is a setting at…
2 votes -
Default Composer doesn't change via SDK
If I change the Default Composer via the Preferences Advanced Type dialog then query it in a script using app.textDefaults.composer I can see it has changed. However when I change it via a script it appears to change when I query it again but it is not changed in the prefs dialog and if I create a new document it is not the default composer. This is all with no open documents btw.
2 votes -
UXP: Cannot clear metadataPreferences
See https://forums.creativeclouddeveloper.com/t/uxp-cannot-clear-metadatapreferences/11775
Assigning an empty string to a string property within Document.metadataPreferences (such as copyrightNotice) fails to clear it. The assignment is silently ignored, and the existing string remains unchanged. You can change it to any value, but not an empty-ish string.
Example from UXP Dev Tools Console):
doc.metadataPreferences["copyrightNotice"] = "TEST"
"TEST"
doc.metadataPreferences["copyrightNotice"] = "" # trying to set empty string
""
doc.metadataPreferences["copyrightNotice"]
"TEST" # should be ''
doc.metadataPreferences["copyrightNotice"] = "TEST UPDATE"
"TEST UPDATE"
doc.metadataPreferences["copyrightNotice"]
"TEST UPDATE" # updating the string worked
doc.metadataPreferences["copyrightNotice"] = '' # trying single quote empty string
""
doc.metadataPreferences["copyrightNotice"]
"TEST UPDATE" # the previous state remained,…1 vote -
Missing styles for Spectrum Web Compontents
When Spectrum Web Components generated via script, they sometimes lose their styling. (See attached screen recordings.)
The elements are inserted using a template element, which is likely causing this problem.
index.html
<sp-theme theme="spectrum" color="light" scale="medium" dir="ltr"> <main> <sp-button id="refesh-button">Refesh</sp-button> <div id="refesh-area"> <!-- generated elements --> </div> <template id="input-item-template"> <div class="input-item"> <sp-field-label class="input-label">Label</sp-field-label> <sp-textfield></sp-textfield> </div> </template> </main> </sp-theme>create.js
const inputItemTemplateElem = document.getElementById("input-item-template"); for(let i=0; i<20; i++) { const inputItemFrag = inputItemTemplateElem.content.cloneNode(true); if(!inputItemFrag || !(inputItemFrag instanceof DocumentFragment)) { console.error("Error when cloning the template."); return; } const inputLabelElem = inputItemFrag.querySelector(".input-label"); inputLabelElem.textContent = "Label " + ++labelIndex; refeshAreaElem.appendChild(inputItemFrag); }I haven’t noticed it…
1 vote -
Uncaught TypeError in sp-theme component
An error message keeps showing with the sp-theme component:
UDT:
./main.js:1109 Uncaught TypeError: Cannot read properties of undefined (reading 'warn')
at r7.attributeChangedCallback (VM11 main.js:1109)
at uxp://uxp-internal/domjsscripts.js:2
at y.attributeChangedCallback (uxp://uxp-internal/domjsscripts.js:2)
at Object.didChangeAttributeForCustomElement (uxp://uxp-internal/domjsscripts.js:2)
at l.didChangeAttributeForElement (uxp://uxp-internal/domjsscripts.js:2)
at e.exports.didChangeAttributeForElement (uxp://uxp-internal/domjsscripts.js:2)
at didChangeAttribute (uxp://uxp-internal/domjsscripts.js:2)
at set value [as value] (uxp://uxp-internal/domjsscripts.js:2)
at set nodeValue [as nodeValue] (uxp://uxp-internal/domjs_scripts.js:2)
at r7.setAttribute (uxp://uxp-internal/domjsscripts.js:2)
main.js
require("@spectrum-web-components/theme/sp-theme.js");
require("@spectrum-web-components/theme/src/themes.js");
require("@spectrum-web-components/theme/src/express/themes.js");
index.html
<sp-theme id="panel-theme" system="spectrum" color="light" scale="medium" dir="ltr">
<header id="panel-header">
<sp-switch id="language-switch" dir="ltr" size="m" focusable="" data-js-focus-visible="">DE/EN</sp-switch>
</header>
<main id="panel-main">
...1 vote -
UXP logs in the wrong folder
The UXP logs for InDesign 2026 still end up in the 2024 folder.
Wouldn't it be more consistent to adjust the path to the corresponding version?
InDesign 21.0, macOS Sonoma
1 vote -
checking text object with isValid breaks reference
I have already described this issue on creative cloud forum for devs: https://forums.creativeclouddeveloper.com/t/accessing-isvalid-property-updates-object-reference/11477
but since there was no response, i still don't know if this a bug.
Basically, reference to text object updates after checking it with isValid.
Steps to reproduce:
1) get selected text in textframe with app.selection[0] and put it in the variable (selection)
2) add some text just before selected text
3) try to select selection with app.select(selection) -> text selected correctly.
4) check selection with isValid (selection.isValid)
5) try to select selection once again with app.select(selection) -> text selected incorrectly.Indesign version: 19.2
Expected behavior: preserve…1 vote -
No consistent way to control undo/redo of script execution
In a UXP plugin, there is no consistent way to control the undo/redo stack.
The closest we have is through
app.doScript, but this is fraught with many issues.- When you run an async UXPScript (most would be, if working with files), the undo mode is ignored.
- You can run extendscript, but as we are trying to move away from that I would like a uxp supported solution. In general, we have run into issue after issue with
app.doScriptusing extendscript.
Ideally, you would fix item 1 and also some of the surrounding issues with UXP script execution (no way…
1 vote -
html5
In indesign desktop version, new functionality to export document directly to html5 is added. We are looking to use the new html5 export functionality with Indesign Server. Seems it's currently not possible to write a script or a plugin to export documents to html 5 other than manually via desktop InDesign UI. (no reference found in SDK documentation)
1 vote -
corrigir bug
Muitos arquivos RTF estão com problemas para ser importado, o indisign acaba fechando. Observação: os arquivos RTF possuem muitas páginas (média de 500 páginas)
1 vote
- Don't see your idea?