What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Interface Writer | [release] 3.0 | 22/08/2010

Pages: (14): « First « 1 2 3 [ 4 ] 5 6 7 8 » Last »
2 votes - 5 average   Interface Writer | [release] 3.0 | 22/08/2010
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [beta] 1.0 -> [release] 1.2
Let me provide you with an example that may be useful to you.....

See attachment

Note that the provided code is untested. You'll have to implement your own way of handling the position, anchoring, attributes and control-specific stuff, but I think you'll be OK with this ;)

.zip File Attachment: Window parser.zip (1.33 KB)
This file has been downloaded 179 time(s).

This post was edited on 06-15-2009 at 04:51 PM by SmokingCookie.
06-15-2009 04:30 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 1.2
Umm... (well, I was about to say there was a problem with line 30, but I found the spelling mistake :))
code:
Function called: OnEvent_Initialize
Error: Object expected (code: -2146823281)
       File: __FnWindowParser.js. Line: 46.
Error: Object expected (code: -2146823281)
       File: __FnWindowParser.js. Line: 46.
Function OnEvent_Initialize returned an error. Code: -2147352567

Line 46:
js code:
if(ControlId in ret.Interface[WindowId].Controls[ControlType]) // ...

Is that what verifies if two control IDs match?  What is the object invovled?  :S

EDIT: there's a similar problem with the Element check as well:
code:
Error: Object expected (code: -2146823281)
       File: __FnWindowParser.js. Line: 61.
Error: Object expected (code: -2146823281)
       File: __FnWindowParser.js. Line: 61.
Function OnEvent_Initialize returned an error. Code: -2147352567

Line 61:
js code:
if(ElementId in ret.Interface[WindowId].Elements[ElementType]) // ...

This post was edited on 06-15-2009 at 06:45 PM by whiz.
06-15-2009 06:27 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [beta] 1.0 -> [release] 1.2
Yeah, that's the thingy that checks whether something exists within an object.

For the errors: I'll fix it tomorrow; I'm gonna go sleeping now |-)
06-15-2009 07:51 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 1.2
quote:
Originally posted by SmokingCookie
For the errors: I'll fix it tomorrow; I'm gonna go sleeping now |-)
Fair enough, I need some sleep as well.  :P
06-15-2009 08:03 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Interface Writer | [beta] 1.0 -> [release] 1.2
Have you slept well? :P

Anyway, here you go with a fix. I've left out the control/element typing. You can do that by retrieving the "xsi:type" attribute of a selected node (so K.item()). I've also included a prototype of my own JSON interpreter, but it does not return valid JSON yet. It's only to give you a basic idea of the object that has been created by parseFile().

.zip File Attachment: Window parser.zip (3.22 KB)
This file has been downloaded 162 time(s).
06-16-2009 12:17 PM
Profile PM Find Quote Report
Flippy
Junior Member
**


Posts: 29
35 / Male / Flag
Joined: Jun 2009
RE: Interface Writer | [beta] 1.0 -> [release] 1.2
I may be stupid lol, but how do I even use this? I installed the script, it says it's started in the preferences/options screen, but I have no idea how to use it lol... I don't see it anywhere?
06-17-2009 11:47 AM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: Interface Writer | [release] 1.2
quote:
Originally posted by SmokingCookie
Have you slept well? :P

Anyway, here you go with a fix. I've left out the control/element typing. You can do that by retrieving the "xsi:type" attribute of a selected node (so K.item()). I've also included a prototype of my own JSON interpreter, but it does not return valid JSON yet. It's only to give you a basic idea of the object that has been created by parseFile().
Ok, let's see.

js code:
var ControlsXPath = "//Interfaces/Window[@Id=\"" + WindowId + "\"]/Controls/Control";
var ElementsXPath = "//Interfaces/Window[@Id=\"" + WindowId + "\"]/Elements/Element";
// Define objects that contain the control types, subdevided into control/element IDs
ret.Interface[WindowId] = new Object();
ret.Interface[WindowId].Controls = new Object();
ret.Interface[WindowId].Elements = new Object();
1) Am I able to create my own, like this?  For example, to get the window title:
js code:
var CaptionsXPath = "//Interfaces/Window[@Id=\"" + WindowId + "\"]/Attributes/Caption";
var TitlesXPath = "//Interfaces/Window[@Id=\"" + WindowId + "\"]/TitleBar/Title/Text";
But...  it can't be enumerated:
js code:
var K = new Enumerator(xml.selectNodes(CaptionsXPath));
It's different, because the value isn't "<Item Parameter="Value">", but "<Item>Value</Item>".  How can I get that?

js code:
var K = new Enumerator(xml.selectNodes(ControlsXPath));
if(K.count() > 0) {
    for(; !K.atEnd(); K.moveNext()) {
        var ControlNode = K.item();
        var ControlId = ControlNode.getAttribute("Id");
        // Define an object for this control type (as in ButtonControl or StaticControl) that contains the actual control
        // Only done when necessary
        if(ControlId in ret.Interface[WindowId].Controls) {
            //[alert the user that there's 2 or more controls with the same ID]
            continue;
        }
        // You'll have to do your own stuff here
        ret.Interface[WindowId].Controls[ControlId] = "null" //[JScript control definition stuff]
    }
}
2a) If that gets a control ID, then I assume that getting the type uses the same method, replacing ".getAttribute("Id")" with ".getAttribute("xsi:type")", right?
2b) Would this work:
js code:
var K = new Enumerator(xml.selectNodes(ControlsXPath + "/Position"));
for(; !K.atEnd(); K.moveNext()) {
    var ControlNode = K.item();
    var ControlLeft = ControlNode.getAttribute("Left");
    // Define an object for this control type (as in ButtonControl or StaticControl) that contains the actual control
    // Only done when necessary
    if(ControlId in ret.Interface[WindowId].Controls) {
        //[alert the user that there's 2 or more controls with the same ID]
        continue;
    }
    // You'll have to do your own stuff here
    ret.Interface[WindowId].Controls[ControlId] = "null" //[JScript control definition stuff]
}

I apologise for so many questions, but this is a confusing topic for me...  :S

EDIT: yes, I slept well.  10 good hours.  :D



quote:
Originally posted by Flippy
I may be stupid lol, but how do I even use this? I installed the script, it says it's started in the preferences/options screen, but I have no idea how to use it lol... I don't see it anywhere?
Go to the Script Menu > "Interface Writer" > "Create a new interface...".  :)

This post was edited on 06-17-2009 at 06:57 PM by whiz.
06-17-2009 06:56 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Interface Writer | [beta] 1.0 -> [release] 1.5
Please update your first post in this thread with the new version instead of attaching it to a new post.

Not doing this will confuse a lot of people (not everybody checks every post in a thread for a new version) and will result in old versions being distributed.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-22-2009 06:11 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: RE: Interface Writer | [beta] 1.0 -> [release] 1.5
quote:
Originally posted by CookieRevised
Please update your first post in this thread with the new version instead of attaching it to a new post.

Not doing this will confuse a lot of people (not everybody checks every post in a thread for a new version) and will result in old versions being distributed.
Done...  (added a link to the top to download it).
06-27-2009 02:57 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Interface Writer | [beta] 1.0 -> [release] 1.5
quote:
Originally posted by whiz
quote:
Originally posted by CookieRevised
Please update your first post in this thread with the new version instead of attaching it to a new post.

Not doing this will confuse a lot of people (not everybody checks every post in a thread for a new version) and will result in old versions being distributed.
Done...  (added a link to the top to download it).
ok, but it is way better to edit your first post and instead replace the old script with the new(est) version.
After that you can remove all the other attachments in your other posts, they aren't needed and people will still be able to download the wrong version.
(remember, not everybody reads an entire thread to know which version is which; mostly, if they see an attachment in a post (after they came directly to that post because they were referred to it fro manother thread), they probably think it is the latest version)...

If you have an update, do the same thing again. Simply replace the previous version with the new version in the first post. no reason to keep older (buggy) versions.

This is done in every other script thread and is the way most people expect it to be. And there can't be any mistakes either with that method.

Having a list of older versions is nice but it makes things much more complicated which isn't needed.

You are bound to make mistakes with all those links.
In fact you already made mistakes (so check all your links, some are wrong).
and this is only with three versions; imagine if you have a whole bunch to keep track of.

;)

This post was edited on 06-28-2009 at 01:28 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-28-2009 01:16 AM
Profile PM Find Quote Report
Pages: (14): « First « 1 2 3 [ 4 ] 5 6 7 8 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On