Scripting

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Oct/2016, at 16:58

[13] Addins: ondropXXX functions should be public


The client functions OnDropXXX are now defined as public and overridable

Modified date: 02/11/2015 17:44:50 - P4 Changelist: 79154 - From build: 2.2.2711.x (T)

 


[13] Fred4: add an OnAction event when changing format from toolbar

GN4-3656

PageDesignerAddin.OnAction() (or PageTxtDesignerAddin equivalent, if in edit) can now manage IEditorialEvent.Actions.FormatChange event when the format of the selected text is changed using toolbar combobox.

Modified date: 23/10/2015 16:45:48 - P4 Changelist: 79004 - From build: 2.2.2701.x (T)

 

[73] Fred4: page.txtformat method return efail selecting the same format of the selection

GN4-3550

Page.TxtFormat returns 1202 on pressing Cancel, or on pressing OK when the same format as the current one is selected. Now when pressing OK it returns always 0.

Modified date: 21/09/2015 17:03:25 - P4 Changelist: 78587 - From build: 2.2.2669.x (T)

 

[74] I4: objectUI conditions need to be supported

GN4-3059

The '''objectUI''' '''conditions''' are now supported.

Modified date: 21/09/2015 11:22:24 - P4 Changelist: 78582 - From build: 2.2.2669.x (T)

 

[190] Shell4: mediagallery onclose event

GN4-3414

A new event is fired before the designer is closed, to allow gallery validation. See Function OnCanClose(). A simple validation example is present (commented out, for backward compatibility).

Modified date: 22/07/2015 17:10:33 - P4 Changelist: 77863 - From build: 2.2.2608.x (T)

 

[96] Ted4: access text copyfit parameters from scripting

GN4-3515

Added the method 'GetCopyFit' to the text object (ITxt) returning the copy fitting parameters of the text in the current geometry.
The parameters are returned into the TeraDP.GN4.Editorial.FitDesc class (more info in http://tech.teradp.com/tech/html/gn4/docs/VSdoc/index.html#frlrfTeraDPGN4EditorialFitDescClassTopic.html).
Added the method 'GetTxtCopyFit' in PageDesignerAddIn, which returns the copy fit parameters of the currently active text.

Modified date: 09/09/2015 17:03:42 - P4 Changelist: 78457 - From build: 2.2.2657.x (T)

 

[103] InputDlg: the category tree doesn't bring into view the selected item

GN4-3511

InputDlg: the category tree didn't bring into view the selected item

Modified date: 04/09/2015 09:53:09 - P4 Changelist: 78391 - From build: 2.2.2652.x (T)

 

[109] Shell4: media gallery interface for media objects

GN4-3490

New script functions available to set media element attributes:
* SetAttribute(attrName, attrValue) set a new value, for the specified attribute, of the selected item. Requires gallery checked-out. Returns "true" for success.
* GetAttribute(attrName) returns string of specified attribute value. "Nothing" if not found.
* SetAttributeItem(mediaItem, attrName, attrValue) works like SetAttribute but on a specified item object, without changing grid selection.
* GetAttributeItem(mediaItem, attrName) works like GetAttribute but on a specified item object, without changing grid selection.
Examples:
<source lang="vb">Dim current_summary = GetAttribute((".summary"))
SetAttribute(".summary", "Checked OK: " + current_summary)
 
For Each item As GridDataItem In Designer.MediaDataGrid.Items
SetAttributeItem(item, ".title", "Empty Title!")
Next

Modified date: 02/09/2015 14:55:29 - P4 Changelist: 78355 - From build: 2.2.2650.x (T)

 

[113] Shell4: OnGalleryOpen event

GN4-3489

The Sub OnGalleryOpen() is now called when loading has finished and the DataGrid is ready.

Modified date: 01/09/2015 15:34:35 - P4 Changelist: 78335 - From build: 2.2.2649.x (T)

 

[167] Fred4: GetFormat function requires id to be initialized

GN4-3448

Breaking Change:
GetFormat doesn't work as it should: the method return an empty object (that can be filled setting the id) and this can cause exceptions and crashes.
To solve this problem the method is changed in '''GetFormat(int formatId)''' that select and initialize the format object.
A sample to get the current format:
<source lang="vb.net">if (Fred.GetActiveTxt isnot Nothing) then
dim oformat=fred.getformat(Fred.GetActiveTxt.FormatId)
end if
 
replaced the old code in all standard scripts.
there is also another utility method to get only the format name from id: '''GetFormatNameFromId(formatId),''' replaced in other script to avoid redundant code.

Modified date: 30/07/2015 12:42:00 - P4 Changelist: 78004 - From build: 2.2.2616.x (T)

 

[185] Shell4: way to "mark" mediagallery elements

GN4-3418

A new item property "custom_BGColor" is available in scritping to mark a media row with a specific color. Example:
<source lang="vb">
For Each item As GridDataItem In Designer.MediaDataGrid.Items
Dim v = CType(item(".variants"), List(Of SearchResult.AccessorBase))
If v.Count = 0 Then
item.custom_BGColor = Media.Brushes.Yellow
End If
Next
Designer.MediaDataGrid.Items.Refresh() ' Update the view
 
Mark "yellow" any item with no variants defined. Use "Media.Brushes.White" to reset to default color.

Modified date: 24/07/2015 14:35:48 - P4 Changelist: 77886 - From build: 2.2.2610.x (T)

 

[164] Fred4: method to know the current library object id

GN4-3447

add 4 new methods visible from script:
Fred.GetActiveLibObjId
Fred.GetActiveLibObjName
Fred.GetActiveLibId
Fred.GetActiveLibName
It returns 0 or empty string in case of missing active library obj document.
warning: The library object is considered active only if the our libobj designer is open and active.
 
modified the caption tab name in libobj designer as requested.

Modified date: 30/07/2015 17:29:18 - P4 Changelist: 78018 - From build: 2.2.2616.x (T)

 

[176] Fred: some method doesn't work using library object

GN4-3438

Fred.GetCurrentLocalTxt works only with pages and this is wrong: localtxts are admitted also in libraries and masters

Modified date: 29/07/2015 11:41:16 - P4 Changelist: 77967 - From build: 2.2.2615.x (T)