GenerateODCLinkToClipboard

Generuje MTBODC odkaz na vybraný proces do schránky

Popis

Vygeneruje MTBODC odkaz na vybraný proces a uloží jej do schránky systému Windows.
declare procedure AddTextToClipBoard dll "ActualDocument"(string)
declare function CreateMTBODCLink dll "ActualDocument" (string): string
declare procedure DocumentID dll "ActualDocument" (string, pointer)
declare function IsActualDocumentAvailable dll "ActualDocument" (pointer): boolean
declare procedure MessageDialog dll "ActualDocument" (string, string)
declare function ShowProcessListExt dll "ActualDocument" (string, string, string, string, string, string, pointer): boolean

script GenerateODCLinkToClipboard(): boolean
var
  Available: boolean
  AvailableKey: string
  Filter: string
  Selected: boolean
  SelectedKey: string
  Link: string
begin
  Available := IsActualDocumentAvailable(actualdocument)

  if Available then
    DocumentID(AvailableKey, actualdocument)

    Filter := "$DOC_KEY <> '" + AvailableKey + "'"
    Selected := ShowProcessListExt(Filter, "rootfolder", "$DOC_CONTENT_CHANGED", "DESC", "", SelectedKey, actualdocument)

    if Selected then
      Link := CreateMTBODCLink(SelectedKey)

      AddTextToClipBoard(Link)

      MessageDialog("Odkaz " + Link + " byl zkopírován do schránky.", "i")
    end
  end

  result := false
end