• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Where would I drop a script in an html if I wanted it to communicate with CPTV8

Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

Hi,

I am trying to make some simple variable changer html files that I can drag and drop into captivate.

I want them to call to captivates cpInfo and cpCmnd Systems variables. Iknow the scripts work as I can get them to work in captivates own script window.

I just need them to operate from a web object.

My html code is this.

//////////////////////////////////////////////////

<html>

<head>

<script>

window.onload = function() {

window.cpAPIInterface.next();

};

</script>

</head>

<body>

</body>

</html>

/////////////////////////////////////////////////////

I thought this would work but nothing happens.

Any help would be appreciated.

Cheers

Luke

TOPICS
Advanced

Views

463

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Sep 01, 2015 Sep 01, 2015

OK I cracked it!

It helps for captivate to have a receiver script. Something like this:

    function Tell_me(string)

{

  window.cpAPIInterface.setVariableValue("Questions",string);

    }

and the html file has a sender script. Like this:

<html>

<head>

<script type="text/javascript">

    parent.Tell_me('The quick brown fox');

</script>

</head>

<body>

</body>

</html>

The data gets sent from one to the other. I think I can do heaps with this from here on.

Votes

Translate

Translate
Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

Hey I figured this out on my own.

//////////////////////////////////////////////////

<html>

<head>

<script>

window.onload = window.cpAPIInterface.next();

</script>

</head>

<body>

</body>

</html>

/////////////////////////////////////////////////////

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

Oops I have a new problem now....

Cptv8 is loading from a cached version of the file I loaded. Its an older html file not the one I want to load.

Is there no end to how rubbish this software is?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

And again oops the above code is incorrect. It was working fine because the code was still sitting in the captivate script window.

I still need help with this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 01, 2015 Sep 01, 2015

Copy link to clipboard

Copied

OK I cracked it!

It helps for captivate to have a receiver script. Something like this:

    function Tell_me(string)

{

  window.cpAPIInterface.setVariableValue("Questions",string);

    }

and the html file has a sender script. Like this:

<html>

<head>

<script type="text/javascript">

    parent.Tell_me('The quick brown fox');

</script>

</head>

<body>

</body>

</html>

The data gets sent from one to the other. I think I can do heaps with this from here on.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2015 Sep 02, 2015

Copy link to clipboard

Copied

Totally off topic, thanks a lot for this workaround but do you mind if I move this thread to the subspace 'Advanced'? You don't want to frighten newbies

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 02, 2015 Sep 02, 2015

Copy link to clipboard

Copied

LATEST

That's fine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources