Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2003
    Posts
    710

    Pass data between AutoPlay applications

    Introduction:
    Occasionally I'm asked how to pass data between AutoPlay applications, or if it is even possible. The easiest way to do this is as follows.

    You will create two applications with the following settings/specifications:

    Application 1:
    This application will have a multi-line input object that the user will type in. Every time a key is pressed within this input object, the on key event will fire.

    Step 1:
    Create a multi-line input object

    Step 2:
    Place the following script on the on-key event of this input object:
    sText = Input.GetText("Input1");
    Registry.SetValue(HKEY_CURRENT_USER, "Software\\Temp_Comm_Local", "Value1", sText, REG_SZ);

    Step 3:
    Place the following code on the On Startup event of your project to clear out any existing value (just in case):
    Registry.SetValue(HKEY_CURRENT_USER, "Software\\Temp_Comm_Local", "Value1", "", REG_SZ);

    Step 4:
    Place the following code on the On Shutdown event of your project, to keep the registry clear:
    Registry.DeleteKey(HKEY_CURRENT_USER, "Software\\Temp_Comm_Local");



    Application 2:
    This application will have a paragraph object that will fill automatically with the text typed in the input object of project 1.

    Step 1:
    Create a paragraph object

    Step 2:
    Place the following script on the On Show event of the page:
    Page.StartTimer(1000);

    Step 3:
    Place the following script on the On Timer event of the page:
    sValue = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Temp_Comm_Local", "Value1", true);
    Paragraph.SetText("Paragraph1", sValue);




    Expected Result:
    Whenever something is typed in the input object in application 1, it will appear one second later in the paragraph object of application 2. You can use this technique to pass any type of value between two autoplay applications.
    Attached Images

  2. #2
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    315
    Another way is the Clipboard plugin.

    First Application copies the info to the Clipboard.

    Second Application scans the Clipboard.
    On Show
    Code:
    Page.StartTimer(1000);
    On Timer
    Code:
    --looks if text is available
    result = Clipboard.IsTextAvailable();
    if result then
    --read the text
    newtext = Clipboard.GetText();
      if String.Find(newtext, "from APMS5", 1, false)~=-1 then
      --only if the the text is from app1 write it to the input object
        newtext = String.Replace(newtext, "from APMS5", "", false);
        Input.SetText("Input1", newtext);
        --clear Clipboard
        Clipboard.CopyText("");
      end;
    end;
    Stefan_M
    Attached Files
    "With a rubber duck, one's never alone."

    Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,135
    Quote Originally Posted by Stefan_M
    Another way is the Clipboard plugin.

    First Application copies the info to the Clipboard.

    Second Application scans the Clipboard.
    On Show
    Code:
    Page.StartTimer(1000);
    On Timer
    Code:
    --looks if text is available
    result = Clipboard.IsTextAvailable();
    if result then
    --read the text
    newtext = Clipboard.GetText();
      if String.Find(newtext, "from APMS5", 1, false)~=-1 then
      --only if the the text is from app1 write it to the input object
        newtext = String.Replace(newtext, "from APMS5", "", false);
        Input.SetText("Input1", newtext);
        --clear Clipboard
        Clipboard.CopyText("");
      end;
    end;
    Stefan_M
    The major problem I see with this solution is that there is a chance that the Clipboard data will be changed before the second AMS application can get at the other AMS application's sent (to the Clipboard) data.
    Intrigued

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I think my clipboard is protected by my antivirus or something... I can use my clipboard as normal but whenever a script tries to use it, something blocks it. That's why I don't rely on the clipboard plug-in in my projects.

  5. #5
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,858
    I would add an action on closing the app to erase the registry entries.
    Good form, you know...

    Yossi

  6. #6
    Join Date
    Jul 2003
    Posts
    710
    Very true. Go online collaboration!

  7. #7
    Join Date
    May 2005
    Posts
    1,115
    Registry is a better solution than clipboard plugin.
    Never know what life is gonna throw at you. ZubTech

  8. #8
    Join Date
    Jun 2002
    Location
    Southeast USA
    Posts
    1,805
    Actually, someone has pointed out before that not every computer will have access to the Registry (some overly cautious IS departments lock 3rd party apps from this luxury). So, perhaps writing and reading from a basic .txt file on the hard drive would be a best practice for sharing data between apps.
    Eric Darling
    eThree Media
    http://www.ethreemedia.com

  9. #9
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I tend to use .txt files personally, so I agree, for many scenarios that's often the easiest way to go.

  10. #10
    Join Date
    Jul 2004
    Location
    Denmark
    Posts
    345

    what if it's a kind of teacher student envirement?

    I have long had an Idea of building a teaching center that uses this precie feature. But I never could get it started.

    The thing is I want to use 2 applications
    Application 1 : The student
    Application 2 : Teacher

    The thing is that you can have multipel student at the same time.
    for exampel doing math like a quiz on the student panel.

    The student will have to put in there name before they can start, AMS then creates a text file with the students name then every student have a unique file for them. then when ever they answer a question the ansver is saved to the file.

    In the teacher app. the teacher gets a list of all the students that are doing there program (a directory read into a table and listed) When he clicks on a students name he can then se what the question was and what the student answered.

    Now here is the tricky part
    The teacher then have the abillety to tick off the questions that are corrept or write notes to the student on where they went wrong. and grading the the test.

    In the student application there should be a function to load old tests and then see the teachers notes.

    It is a bit tricky but it must be posible to do you can create, read and write the txt files in your AMS app. and you can even have the app put the files in a special folder on a network drive that the students dont have access to but the app has permissions.

    so I'm thinking this is duable but how!!!

    I'm lost...

Similar Threads

  1. HOWTO: Build and Burn Your AutoPlay Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 04:43 PM
  2. PROBLEM: AutoPlay Application Does Not Start Automatically
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-25-2002, 03:21 PM
  3. PROBLEM: AutoPlay Application Does Not Start Automatically
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-25-2002, 01:39 PM
  4. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 04:36 PM
  5. FAQ: AutoPlay Menu Studio 3.0 Frequently Asked Questions
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-10-2002, 02:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts