Syntax

code

Procedure: IPropertyObject.EditScript;


Description

Opens the script property in the script editor. If the property is not of type ptScript this method is ignored.


Code Reference


code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

procedure editScript;

var

  ps: IPlanSwift;

  itm: IItem;

  prop: IPropertyObject;

begin

  //Create the Planswift Interface

  ps := coplanswift.Create;

  //Get the selected Item

  itm := ps.SelectedItem;

  if varisClear(itm) then begin

    ShowMessage('Please Select an Item');

    //Clear Interface

    ps := nil;

    //Exit Procedure

    Exit;

  end;                                     

  //Create new Property with the property type as script

  prop := itm.NewProperty('Example Script','',ptscript);

  //Set the script language to pascal

  prop.ScriptLanguage := slPascal;

  //Open Scripting dialog

  prop.EditScript;

  //Free Planswift Interface

  ps := nil;

end;