Navigation: Scripting Reference Manual > Functions & Subroutines > KeywordSetDescription

 

KeywordSetDescription

 

Contact Us: fredsupport@photonengr.com

 

Description

Sets the string description of a specific keyword node.

 

 

Syntax

kwRet = KeywordSetDescription( kwNode, kwDesc )

 

 

Parameters

kwRet (Long)

Returned value indicating success or failure of setting the description.  If the operation is successful, the returned value is the same as kwNode.

 

kwNode As Long

Node number of the keyword being modified.

 

kwDesc As String

Description string being applied to the keyword.

 

 

Example

The example below loops over the keywords in the document, retrieves the number of items each keyword is applied to, and resets the description string for any keyword applied to 1 or more items.

 

Sub Main

 

    ClearOutputWindow()

 

    'Get the count of existing keywords

    Dim kwCount As Long

    kwCount = KeywordCount()

 

    'Loop over each keyword and retrieve the items and item count

    'that the keyword is assigned to

    Dim curKw As Long, kws(0) As Long, items() As Long, itemCount As Long

    For curKw = 0 To kwCount-1

        kws(0) = curKw

        itemCount = KeywordsGetAppliedItems( "ent", kws(), items() )

        Print "Keyword " & KeywordGetName( curKw ) & " is assigned to " & itemCount & " items."

        If itemCount > 0 Then

            KeywordSetDescription( curKw, "Used" )

        End If

    Next

 

End Sub

 

See Also

Keyword Scripting Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC