Accessing Premiere's API
I apologize for the noob question, but I'm new to html and its relationship with javascript.
I have a premiere panel I'm working on, and have set some buttons to link up to functions in my javascript file using onClick. I've got it working to the point where the buttons can trigger a basic alert. But when I try to access Premiere objects, like "app.project", the script fails.
What am I doing wrong here?
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="./jsx/RenameItems.js"></script>
<script src="./lib/CSInterface-4.0.0.js"></script>
<script>
function Replace() {
findAndReplace(document.getElementById('find').value, document.getElementById('replace').value);
}
function AddPrefixAndSuffix() {
addPrefixAndSuffix(document.getElementById('prefix').value, document.getElementById('suffix').value);
}
</script>
<style>
body {
font-size: 75%;
color: #b1b1b1;
}
th, td {
padding: 0px;
}
table {
border-spacing: 10px 5px;
}
button {
width: 100%;
}
</style>
<title>Rename Items</title>
</head>
<body bgcolor="#232323">
<div id="content">
<table>
<tr>
<th align="left">Prefix:</th>
<th><input type="text" id="prefix"></th>
</tr>
<tr>
<th align="left">Suffix:</th>
<th><input type="text" id="suffix"></th>
</tr>
<tr>
<th colspan="2"><button type="button" onClick="AddPrefixAndSuffix()">Add Prefix/Suffix</button></th>
</tr>
<tr>
<th align="left">Find:</th>
<th><input type="text" id="find"></th>
</tr>
<tr>
<th align="left">Replace:</th>
<th><input type="text" id="replace"></th>
</tr>
<tr>
<th colspan="2"><button type="button" onClick="Replace()">Replace</button></th>
</tr>
</table>
</div>
</body>
</html>
function findAndReplace($find, $replace)
{
alert($find + ' ' + $replace);
alert(String(app.project));
}
function addPrefixAndSuffix($prefix, $suffix)
{
alert($prefix + ' ' + $suffix);
}
