IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#57387 - 01/14/20 11:51 AM Planet Press Talk (Generate GUID)
Anwar Hussain Offline
OL Toddler

Registered: 12/02/17
Posts: 39
Loc: OH
Hi Planet Press Team,

Any idea, how can we generate a globally unique Identifier in Planet Press talk ?

E.g.: 17394cf1-f8a7-4325-88bc-707125b960ab

Thanks

Anwar Hussain

Top
#57388 - 01/14/20 02:45 PM Re: Planet Press Talk (Generate GUID) [Re: Anwar Hussain]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
You could do this in a couple of ways depending on how many times you wish to get a unique ID.

1. If you only wish to get one unique ID for each use of the PlanetPress Design document, then I would create the GUID using the %U variable in workflow and store that into a local variable which you pull through to the template using:
Code:
=ExpandString('%{MyVariable}')

You could of course shortcut this and go straight to =ExpandString('%U') but it's better practice to see what you're doing and create it in workflow first.

2. If you need multiple GUIDs, then I would consider using an external script to create one. You could do this by calling an external VBScript or JScript or similar by making use of the execscriptfile function. More information on this is available here.

NB: I would make the call to this external script inside a condition which filters the printermode so that you're not constantly requesting GUIDs in design mode. Each time anything is clicked or moved in Design, the whole document runs through as if triggered.

For example:
Code:
if(&printermode <> 0)
<execute your script>
endif()

More information is available on printer modes here.

Note: For those who can enlighten me - I wasn't sure how the workflow would behave for multiple calls of the same system variable (i.e. %U) - I couldn't be sure whether it would give you the same GUID or multiple GUIDs without testing.

Hope this helps.

Regards,

James.

Top
#57389 - 01/15/20 08:36 AM Re: Planet Press Talk (Generate GUID) [Re: Anwar Hussain]
Anwar Hussain Offline
OL Toddler

Registered: 12/02/17
Posts: 39
Loc: OH
Thank You Jim.

Top
#57390 - 01/15/20 09:14 AM Re: Planet Press Talk (Generate GUID) [Re: Anwar Hussain]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
I should add to this that I have used the %U system variable which is only available in the later versions of workflow - those released with Connect.

Therefore, option 2 might be the greater of the two unless you are happy with a non-GUID, unique 15-char variable, in which case %u (lowercase) is available in the legacy workflow tool.

Any problems, let us know.

Cheers,

J.

Top