Passing Handle Pages

This is a place for people to chare the custom macros they have written.

Moderator: Moderators

icke_siegen
Posts: 904
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

Passing Handle Pages

Postby icke_siegen » 22 Jun 2018, 10:35

Is there a way to pass the handle page to functions which expect only handlegroup and index?

I want to store a cue:

Code: Select all

Playbacks.StoreCue("PlaybackWindow", 1000, false)


However I cannot store this specifically to a certain playback page. Is there a way to pass the page to the function?
User avatar
Gregory
Site Admin
Posts: 1134
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: Passing Handle Pages

Postby Gregory » 24 Jun 2018, 11:47

No I’m afraid not. These functions are for use in places like the Record menu where the user is selecting a physical button and as such are hard coded to use the current page. The only suggestion I can make is to change the page prior to calling the function.
User avatar
sideshowbond
Posts: 159
Joined: 18 Nov 2016, 20:58

Re: Passing Handle Pages

Postby sideshowbond » 24 Jun 2018, 13:13

is there a way to determine the current page so I could change back once StoreCue has run?
User avatar
Gregory
Site Admin
Posts: 1134
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: Passing Handle Pages

Postby Gregory » 24 Jun 2018, 21:45

Here is an example of how you can do this:

Code: Select all

ActionScript.SetProperty("UserMacros.CurrentUserNumber", Handles.PlaybackWindow.Page.Index)
Handles.PlaybackWindow.ChangePage(1)
ActionScript.SetProperty("Playbacks.PendingLegend", Handles.PlaybackWindow.Page.DisplayName)
Playbacks.StoreCue("PlaybackWindow", 20, false)
Handles.PlaybackWindow.ChangePage(UserMacros.CurrentUserNumber)
This uses the UserMacros.CurrentUserNumber property, which is an integer, as a temporary store for the original page index so that page can be restored later. In the example the legend of the playback is also set to the name of the page it is on; not a useful thing to do but there to demonstrate what you can do.

Pages have the following properties:
  • Index: The internal page index, starts from zero.
  • DisplayIndex: The page number that is displayed to the user, normally starts from one except for the preset pages on the Pearl Expert.
  • Name: The legend of the page.
  • DisplayName: The legend of the page if it has been set otherwise the display index.

Who is online

Users browsing this forum: No registered users and 3 guests