Forum Discussion

JillCasey's avatar
JillCasey
Community Member
3 years ago

JavaScript to email and print a slide in Storyline 360

Hi, I am trying to email and print a slide in my storyline project and neither of them are working. Here is the code I am using.

Email:

var player = GetPlayer();

var email=player.GetVar("TextEntry12");

var subject="My Strategy Team";

var visionaries=player.GetVar("Visionaries");
var problemsolvers=player.GetVar("ProblemSolvers");
var doers=player.GetVar("Doers");

var mailto_link='mailto:'+email+'?subject='+subject+'&body='+"My Strategy Team - Visionaries:%0d%0A"+visionaries+"%0d%0A%0d%0AMy Strategy Team – Problem-Solvers:%0d%0A"+problemsolvers+"%0d%0A%0d%0AMy Strategy Team – Doers:%0d%0A"+doers;

win=window.open(mailto_link,'emailWin');

 

Print:

var myWindow = window.open("","Print","width=810,height=610,scrollbars=1,resizable=1");
var headline=player.GetVar("PrintTitle");
var usernotes=player.GetVar("notes");
var visionaries=player.GetVar("Visionaries");
var problemsolvers=player.GetVar("ProblemSolvers");
var doers=player.GetVar("Doers");
var contents = "<html><head></head><body style='width:650px;padding:20px;'>"
contents+= "<div style='height:20px;padding:10px;margin-bottom:20px;text-align:center;'><button onclick='javascript:window.print();'>Print My Notes</button></div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Visionaries</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+visionaries+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Problem-Solvers</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+problemsolvers+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Doers</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+doers+"</div>";
contents+= "</body></html>"
myWindow.document.write(contents);

 

I do not know a lot about JavaScript. Any suggestions?