Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Create fake pop-up error message

  1. #1

    Create fake pop-up error message

    Hi, I'm trying to program a medialab file such that a fake text box comes up saying that there has been a computer error with the program and that it needs to be shut down (and look just like what you would normally see on a windows computer whenver there is an error). I remember that there is a way to program pop up windows, but I can't remember how. Anyone know how?

  2. #2
    jarvis24 Blair Jarvis, Administrator
    What do you want to happen from that point? e.g., Is it just the appearance you want or do you want the button box to have any functionality?

  3. #3
    Mostly appearance. If anything I'd want it to reappear if it is clicked on so that the subject cannot advance past that point (requiring a ctl/alt/dlt restart).

  4. #4
    jarvis24 Blair Jarvis, Administrator
    There are a couple ways to do this. The simplest would be to create a fill in the blank question and use the top (t) parameter to move the question off the screen (e.g., t2000). For question wording, instruct the subject to press "enter" to continue. This will bring up a message box that says something like "it would be ideal if you were to type something". You can edit the text of that message using a substitute.txt file (see user's guide for the section on using the messages.txt and substitute.txt files, or online here: http://www.empirisoft.com/medialab/help/preferences.htm).

    You could change the text to "There has been a system error. Press enter to continue" or whatever you like. They can keep pressing enter and they will keep getting this message.

    Slightly more complicated solutions might allow more flexibility (e.g., creating a custom html page) but this would be pretty quick to implement.

  5. #5
    I have a similar question. I need to create a pop-up box after a custom item (the html file asking subjects to do calculations and enter their answer in a text box). No matter what they enter, they will see a message saying that the number was wrong. However, they should be allowed to move on to the next page if they decide to give up by clicking "Continue."

    Could you help me with this? Thank you so much!

  6. #6
    jarvis24 Blair Jarvis, Administrator
    Do a search in the MediaLab forums here on "validate" or "validation". That should turn up some threads discussing conditional pop-up windows when using custom items via HTML forms and the various options you have from that point onward.

  7. #7
    Maybe I can help directly, I've done such a thing a view weeks ago.

    I simply started the browser by the custom-item-type and presented a html-page within the browser with the task description (you have to make one and put the location of the file in the parameters). By using the <form>-tag and a little javascript which you put in the header of the html-file you can validate participant input. If you use a value that the participant isn't able to respond with, everytime a windows pops up with a message you want (e.g. "NO! Try it once again!", you have to write the message in the code of the javascript) and a simple "OK"-Button.
    I added a line in the task description that they can continue if they close the browser window. If the participant do that, the browser window is closed (of course) and ML tells the participant to click on "Continue". Just click "WriteRT" in the ML-file of the custom item from wich you call the browser and you also have a measure how hard the participant tried to answer the question (the RT of the custom item type, or to put in another way, how long they stay doing the custom item).
    If you are at least a little bit firm with html-programming, this works really nicely.

    BTW: I use Openoffice to create the whole "workaround" of the HTML-file (e.g. tables and stuff like that), because it works like a WYSIWYG-Editor and also provides relatively "simple" hmtl-code (don't try to do that with MS-Word, it's horrible ;-)). So you just need a little bit of understanding of the code, but not extraordinary html-programming skills. In a second step I use a html-editor (in my case Aptana Studio which you also get for free) to modify the html-code (e.g. to put in the javascript).

    Best,
    7om

  8. #8
    Thanks for the great response Tom!

  9. #9
    Hello everyone!
    I have a way of doing this- and I'd like to share it with everyone.
    First off- this works on absolutely and type of computer, so long as it has a text document [not microsoft word] just plain text document or notepad will do.
    Next, type this in on the first line (do not forget the spaces) : onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")

    thats all!!! You can do lines like this :

    onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")
    onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")

    ... and despite what you click it will move onto the next box.
    In fact- you can try this as an example - copy and paste it into notepad:

    onclick=msgbox ("Vista has encounted an error and may need to shut down.",67,"Error detected!")
    onclick=msgbox ("Vista has identified an error and will shut down in order to protect your files.",894375,"Vista has detected an error")
    onclick=msgbox ("Confirm shutting down? All your unsaved progress may be lost.",17,"Vista has detected an error")

    There! Now remember each 'onclick...' must have it's own line. Ok, now save it as- something.vbs [*.vbs is important!!!] by click on the drop down and click 'all files' instead of '*.txt' Now you saved it, access it and it will appear! Despite clicking cancel it will still move on to the next box.
    This is great for pranks and tricks, you edit the text- and the numbers. The numbers are the choices there are. Take '894375' and when you access it- you have only one choice. Just have a go- it's great!!! Don't worry, nothing bad will happen- it's just a trick- it won't really restart.

    All the luck in the world,

    Mike.
    [any queries, just ask and I'll help]

  10. #10
    Thanks for the great addition to this thread Mike.

  11. #11
    Hello everyone!
    I have a way of doing this- and I'd like to share it with everyone.
    First off- this works on absolutely and type of computer, so long as it has a text document [not microsoft word] just plain text document or notepad will do.
    Next, type this in on the first line (do not forget the spaces) : onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")

    thats all!!! You can do lines like this :

    onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")
    onclick=msgbox ("<put what you want>",any number,"<put what you want for the blue bar>")

    ... and despite what you click it will move onto the next box.
    In fact- you can try this as an example - copy and paste it into notepad:

    onclick=msgbox ("Vista has encounted an error and may need to shut down.",67,"Error detected!")
    onclick=msgbox ("Vista has identified an error and will shut down in order to protect your files.",894375,"Vista has detected an error")
    onclick=msgbox ("Confirm shutting down? All your unsaved progress may be lost.",17,"Vista has detected an error")

    There! Now remember each 'onclick...' must have it's own line. Ok, now save it as- something.vbs [*.vbs is important!!!] by click on the drop down and click 'all files' instead of '*.txt' Now you saved it, access it and it will appear! Despite clicking cancel it will still move on to the next box.
    This is great for pranks and tricks, you edit the text- and the numbers. The numbers are the choices there are. Take '894375' and when you access it- you have only one choice. Just have a go- it's great!!! Don't worry, nothing bad will happen- it's just a trick- it won't really restart.

    All the luck in the world,

    Mike.
    [any queries, just ask and I'll help]



    Mike, would you know a way to replace the "onclick" for something that makes the pop up box appear after a certain amount of minutes has passed?

    Thanks in advance,
    Victoria

  12. #12
    Sorry VictoriaVisser, I've been experimenting with VBScript for some time now, and I know it's posible to make it disappear after a set amount of time, but I can't find anyway to make it appear except secretly pressing it!
    I have a few tips:
    ... if you want to change the icon and make it less suspicious, then create a shortcut and link it to the file and then, change the shortcut icon via 'properties' and you can make it look like an Internet Explorer shortcut that is 'experiencing some difficulties'! ...

    ... download this attachment attached for an advanced method of VBScripting, (Note: it is text document- you'll have to change the ending to .vbs instead of .txt) and if you just want to copy and paste then :

    x=msgbox("Delete local disc D?",36,"Disc cleaner")
    If x=vbNo Then
    x=msgbox("Really no?",36,"Adjusting")
    If x=vbNo then
    x=msgbox("But you can't stop it.",64,"Status")
    End if
    End if
    x=msgbox("Cleaning is starting.",64,"Disc cleaner")


    Please remember nothing bad will happen.
    Still researching and experimenting.

    Mike