Identifying a desklet via AveDesk COM engine

Hi there :) -

I got a problem controlling a desklet by another desklet via the COM engine of AveDesk.

What I'm trying to do is this:

1. Make a list of all running desklets

2. Choose one of the desklets

3. Let it do sth.

So far so good - the problem is, next time I start AveDesk I want to control this desklet again without going through the steps 1 and 2 again - just pressing a button and the desklet is controlled.

So I have to find this desklet again in the group of running desklets.

As far as I know a desklet can be identified by Item number, Label, Handle or Tag.

But after a restart of AveDesk

- every desklet has new different handles,

- the desklets are enumerated again - not necessarily in the same order,

- Labels can address more than one desklet (multiple instances) and some desklets don't even have Labels (giving e.g. an AveScripter desklets a label via desklet properties won't be saved with the theme)

- Tags are not saved with the theme either (only way would be the group identifier effectlet, meaning there's no mouseover effect possible)

Does anyone know a way to identify a desklet clearly (using AveScripter)?

#443378

- Tags are not saved with the theme either (only way would be the group identifier effectlet, meaning there's no mouseover effect possible)

we had an old discussion about this, and the result was I wrote the group identifier :) currently, there is no internal, unique and persistant identifier for a desklet

edit: funny, I thought that happened a long time ago, but it was actually Jan 2006... this gives me lots of creepy thoughts

#443379

Ah :) - I should have searched all of aqua forum, not just Ave's Apps...

Would have spared me lots of work... (E.g. I did a function that tagged all running desklets - unfortunately all gone by next start... :( )

Well, looks like I have to do a lot of workarounds then...

One of my problems is, that using the AveDesk COM engine within a desklet doesn't work properly if its script is written in VBS - so I had the desklet call another AveScripter desklet which used JS and did the work... but passing information from one desklet to the other is a real problem (how to adress the desklets, when has a function finished work and the information can be queried...

#443547

uhm, I thought vbs and js would work the same way... what's the piece of code that doesn't behave in VB ?

#443560

I could update the current build of avedesk in such a way that the tag is persisted?

#443570

Hi there -

@dreadnaut:

With VBS I can't get any information about ...avedesk.RunningDesklets.Tags/HWnd/Label/... Every time I try to change properties or get information about running desklets using an Avescripter desklet with VBScript the desklet gets stuck or at least takes about 10 minutes to fulfill the task (on a fast pc). A desklet with JS does the job without any problems. So the only workaround I could find when trying this with a desklet written in VBS was this:

Create an invisible Minidesklet in JS, export it and load it by the other desklet as object, giving it parameter values etc.

This cooperation of two desklets sometimes gets stuck for a small time, too - if the control panel isn't opened...

If the AveDesk control panel is opened (window not minimized) this coop works fast and fine?!...

@Ave:

Sounds great - it would give an opportunity to really identify desklets - e.g. like tag them once, save the theme?

A nice thing would be also to e.g. be able to tag a desklet itself, like e.g. putting in the XML of an AveScripter desklet a tag value ( like xyz in the desklet section). So desklets with changing labels would still be recognizable.

#443615

If it's only for avescripter desklet, you can probably use IDesklet.ObjectModel or something like that to access the avescripter's desklet object .

IDesklet.ObjectModel.Properties("yourtag").value = "bla" . might be a workaround?

#443661

Hi -

err, I try that, just not sure so far, how to use the IDesklet.ObjectModel...

I've realized that herd has edited the Avedesk Scripting Reference & Desklet SDK thread and linked some sample scripts?! -

unfortunately I was unable to find them when clicking the links...

Well I hope I find some time to play around with the IDesklet.ObjectModel tonight... :)

#443740

Hi there -

I just realized desklets are in a way like Schroedinger's cat...

Why? Well, in order to get a list of all running desklets I did this:

As an AveScripter desklet running on VBScript can't access the running desklets via COM, it

therefore launches another desklet running on JScript which does the job. So the

second desklet is kind of invisible (1*1pixel, alpha=100), retrieves the list and saves it to a parameter,

while the first desklet is still kind of the active one and does this:

set listdesk = this.LoadScriptDesklet(dlistdesk, true)

this.sleep("1000")

alldesks = listdesk.Parameters("listparam").Value

listdesk.Close()

So - as the desklet is practically invisible you can't watch it and - like the cat - can't see if it's

doing something. Therefore it does nothing it all... both desklets get stuck, nothing happens...

If I open the control box however and look inside, the desklet uncertainity function collapses and I can see the

second desklet. Suddenly I therefore get a result by the second desklet ceasing its function, and the first one

stops sleeping and gets, as the experiment's result, the parameter, closes the other desklet and the cat is dead...

Time for a quantum computer...

#444159