I'm having issues witha script that i'mc alling from an alias... I'm not sure if i set up the alias right or ...
Anyway, when i try this script (without the arguments in the definition or output) using Immediate, it works fine, but when i try to call it from a labeled alias on a menu, it fails, giving the following error
Error number: -2146828283
Event: Execution of line 148 column 1
Description: Invalid procedure call or argument: 'mid'
Called by: Function/Sub: getSelection called by alias
Reason: processing alias "cure"
for some reason it no longer likes the use of mid, even though it worked fine without the alias calling it...
here's the script
sub getSelection (thename, theoutput, thewildcards)
dim selLine
dim selTarget
dim selLength
selLine = GetLineInfo(GetSelectionStartLine, 1)
selLength = GetSelectionEndColumn - GetSelectionStartColumn
selTarget = mid(selLine, GetSelectionStartColumn, selLength)
world.note "Selected text is '" + selTarget + "'. thename is '" + thename + "'. theoutput is '" + theoutput + "'. thewildcards is '" + thewildcards + "'."
end sub
The idea here, is to Capture whatever is selected in teh output window, and execute commands on it. for instance if "Dreya" is highlighted, and I Ctrl-Click for the Alias menu, selecting "Cure" will send "Cast cure Dreya" to the world.
Another issue i'm running into, and hence the output of the arguments in this test version, is I want to use this one routine in one of two ways: either return the value of "selTarget" to the alias so the alias can use it to send to the world (not possible as far as i can tell) or use this one routine for multiple aliases, sending a different command to the world for each. ie, it would be used for "cast cure" for "identify" for "scrap" for "junk" ... etc. off the top of my head i can think of the following uses I would like for this one routine, witht he highlighted text in <>
cast cure <player>
cast armor <player>
(and other spells)
identify <object>
scrap <object>
junk <object>
put <object> in (alias-defined container)
put <object> in )other alias-defined containers)
Any input on why my current revision is failign on the mid line, or how i can get my ultimate goal to work (if possible) would be greatly appreciated =)
|