Saving ADE state without user interaction (2)

J

Julian

Guest
Hello!

I am trying to save the state of the currently opened ADE-window to a
given directory.

My solution looks like this:

//get session object
session=sevSession(hiGetCurrentWindow())
//open the "Save state" dialog
sevSaveState(session)
//set values
sevSaveForm1->optionCellView->value = "Directory"
sevSaveForm1->stateSaveDir->value = "~/myArtistStateDir"
sevSaveForm1->name->value = "mystate"
(_sevSelectComponentField ''sevSession1 ''save ''all)
//close form
hiFormDone(sevSaveForm1)

Unfortunately, this is not working anymore after you have closed and
re-opened the ADE window, because now the "save state"-form name has
changed to "sevSaveForm2". So how can I access this form in general
way.
Or is there an easier way of doing this?

Thanks in advance

Julian
 
Julian wrote, on 06/20/08 09:12:
Hello!

I am trying to save the state of the currently opened ADE-window to a
given directory.

My solution looks like this:

//get session object
session=sevSession(hiGetCurrentWindow())
//open the "Save state" dialog
sevSaveState(session)
//set values
sevSaveForm1->optionCellView->value = "Directory"
sevSaveForm1->stateSaveDir->value = "~/myArtistStateDir"
sevSaveForm1->name->value = "mystate"
(_sevSelectComponentField ''sevSession1 ''save ''all)
//close form
hiFormDone(sevSaveForm1)

Unfortunately, this is not working anymore after you have closed and
re-opened the ADE window, because now the "save state"-form name has
changed to "sevSaveForm2". So how can I access this form in general
way.
Or is there an easier way of doing this?

Thanks in advance

Julian
Unfortunately there's no public API to save the state without a form - at least
not until IC612, where you have asiSaveState() (this doesn't exist in IC5141).

Rather than using a defined variable for the sevSaveForm1, you could use
hiGetCurrentForm() - which will return the current form.

Bit messy, unless you're using IC61.

Regards,

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top