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

How to create xml structure with scriptng instead of using the menu?

New Here ,
Mar 25, 2022 Mar 25, 2022

I need to programmatically create the xml structure of documents.

There is a panel menu entry for doing this. (Attachment.)

But what is the scripting equivalent of this "Add Untagged Items"?

TOPICS
Scripting
209
Translate
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

correct answers 1 Correct answer

Community Expert , Mar 25, 2022 Mar 25, 2022

Hallo BioMachine7,

drei Möglichkeiten:

 

[1] Du findest im DOM die richtige Methode, die das für Dich erledigt.

[2] Du musst Dir dafür Deine eigene Funktionalität selbst bauen.

[3] Du rufst das entsprechende Menü-Kommando per Skript auf.

 

Für [3] wird wohl das hier funktionieren:

app.menuActions.itemByName("$ID/Structure_GeneratePDFStructure").invoke();

 

Gruß,
Uwe Laubender

( ACP )

Translate
Community Expert ,
Mar 25, 2022 Mar 25, 2022

Hallo BioMachine7,

drei Möglichkeiten:

 

[1] Du findest im DOM die richtige Methode, die das für Dich erledigt.

[2] Du musst Dir dafür Deine eigene Funktionalität selbst bauen.

[3] Du rufst das entsprechende Menü-Kommando per Skript auf.

 

Für [3] wird wohl das hier funktionieren:

app.menuActions.itemByName("$ID/Structure_GeneratePDFStructure").invoke();

 

Gruß,
Uwe Laubender

( ACP )

Translate
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
New Here ,
Mar 28, 2022 Mar 28, 2022
LATEST

[1] Konnte bei indesignjs und in den offiziellen scripting PDFs keine passende Methode finden.

[3] hat gut funktioniert.

Danke.


Mein nächstes Problem war wie man an die sprachunabhängigen (language independent) namen kommt.

Für VB.NET Leute lasse ich hier einfach mal ein Code-Schnipsel zurück.

 

Dim app = CreateObject("InDesign.Application")

Dim menuActions = app.menuActions

For i = 1 To menuActions.count
    Dim m = menuActions(i)
    Dim li = app.findKeyStrings(m.name.ToString)

        If li.length > 0 Then
            Debug.WriteLine(m.id & " | " & m.area & " | " & m.title & " | " & li(0))
        End If

Next

' ...
' 78632 | Struktur-Menü | Objekte ohne Tags hinzufügen | $ID/Structure_GeneratePDFStructure
' ...

 

Translate
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