Adding a scripting interface to FloatingTag?

I mean, what minimal set of labels could be added that enables extending 
the use of FloatingTag through scripts?

For instance, if I wanted to create a TagManager script with actions 
such as:
- close all tags
- add window under to tag X
- toggle tag X top / not on top

What labels would I look for? I can think of three:
@EnumerateTags, @GetTagProperty, @SetTagProperty

The remainder of this message sketches the 3 new labels and works out 
the TagManager example.

; New proposed label in FloatingTag.powerpro
@EnumerateTags
; the EnumerateTags label returns a list of names of all
; currently active tags

; Implementation of "close all tags"
; in MyScript.powerpro:
@CloseAllTags
local [EMAIL PROTECTED]
local i
for(i=1; i<=line(tags,0); i=i+1)
  [EMAIL PROTECTED](line(tags,i))
endfor
quit

; New proposed label in FloatingTag.powerpro
@GetTagProperty
; the GetTagProperty label returns a list of property
; values of a given tag passed as arg(1)
; arg(2) is the property name, with possible values:
; "handles" : returns a list of all handles that are
;       associated with the tag
; ...   : other properties to be defined

; Implementation of "add window under to tag X"
; in MyScript.powerpro:
local tagX=arg(1)
local under=win.handle("under")
local [EMAIL PROTECTED](tagX,"handles")
[EMAIL PROTECTED](tagX)
.FloatingTag(under++","++handles)
; maybe a bit too crude implementation...
quit

; New proposed label in FloatingTag.powerpro
@SetTagProperty
; the SetTagProperty label sets a property value
; of a given tag passed as arg(1)
; arg(3) is the new property value
; arg(2) is the property name, with possible values:
; "topstate" - 1 if tag is on top, 0 otherwise
; ...   : other properties to be defined

; Implementation of "- toggle tag X top / not on top"
; in MyScript.powerpro:
local tagX=arg(1)
local toggle = [EMAIL PROTECTED](tagX,"topstate")
[EMAIL PROTECTED](tagX,"topstate",not toggle)
quit

What other property names would be valuable and possible for 
@GetTagProperty and @SetTagProperty ?



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to