Skip to main content
Pedro Cortez Marques
Legend
March 15, 2014
Answered

keywordsManager: (get native code)

  • March 15, 2014
  • 1 reply
  • 572 views

On ESTK, running over Bridge CS6, this fives me a function:

$.writeln(app.document.keywordsManager.renameKeyword)

I get on console:

function renameKeyword() {

    [native code]

}

How can I get the native code of that function?

I do not know how the arguments are organized and how it can be used.

I can also get my active key words like this:

app.document.keywordsManager.serializeToXML()

and I have also other functions I would like to test how to use, like

addKeyword(??), renameKeyword(??), deleteKeyword(??)

This topic has been closed for replies.
Correct answer Pedro Cortez Marques

I solve it.

//~ app.document.keywordsManager.addKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.deleteKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.renameKeyword (oldName:String, newName:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.serializeToXML()

Note regarding sub keywords creation:

when useHierarchicalPath is true, the function will seek the keywordPath string and if it detects a vertical slash (for example "aaa|bbb") that means a keyword "aaa" and a sub keyword "bbb" will be created. "aaa" is created if doesn't exist.

This is the same logic used on deleteKeyword and renameKeyword.

Examples:


addKeyword

app.document.keywordsManager.addKeyword ("some words", true); // adds the keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", true); // adds the keyword "things" and the sub keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", false); // this adds the keyword "things|some words" and ignores the vertical dash

deleteKeyword

app.document.keywordsManager.deleteKeyword ("aaa|bbb", true); // delets the sub keyword "bbb"

app.document.keywordsManager.deleteKeyword ("aaa", true); // delets the keyword "aaa" and all its sub keywords

renameKeyword

app.document.keywordsManager.renameKeyword ("aaa|bbb", "aaa|ccc", true); // rename the sub keyword "bbb" to "ccc"

app.document.keywordsManager.renameKeyword ("aaa", "a11", true); // rename the keyword "aaa" to "a11"

serializeToXML

app.document.keywordsManager.serializeToXML(); // returns the xml of all the keywords structure

1 reply

Pedro Cortez Marques
Pedro Cortez MarquesAuthorCorrect answer
Legend
March 31, 2014

I solve it.

//~ app.document.keywordsManager.addKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.deleteKeyword (keywordPath:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.renameKeyword (oldName:String, newName:String, useHierarchicalPath:Bollean)

//~ app.document.keywordsManager.serializeToXML()

Note regarding sub keywords creation:

when useHierarchicalPath is true, the function will seek the keywordPath string and if it detects a vertical slash (for example "aaa|bbb") that means a keyword "aaa" and a sub keyword "bbb" will be created. "aaa" is created if doesn't exist.

This is the same logic used on deleteKeyword and renameKeyword.

Examples:


addKeyword

app.document.keywordsManager.addKeyword ("some words", true); // adds the keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", true); // adds the keyword "things" and the sub keyword "some words"

app.document.keywordsManager.addKeyword ("things|some words", false); // this adds the keyword "things|some words" and ignores the vertical dash

deleteKeyword

app.document.keywordsManager.deleteKeyword ("aaa|bbb", true); // delets the sub keyword "bbb"

app.document.keywordsManager.deleteKeyword ("aaa", true); // delets the keyword "aaa" and all its sub keywords

renameKeyword

app.document.keywordsManager.renameKeyword ("aaa|bbb", "aaa|ccc", true); // rename the sub keyword "bbb" to "ccc"

app.document.keywordsManager.renameKeyword ("aaa", "a11", true); // rename the keyword "aaa" to "a11"

serializeToXML

app.document.keywordsManager.serializeToXML(); // returns the xml of all the keywords structure