Skip to main content
Participant
June 27, 2010
Question

Access Thumbnail & Folder info from Webpage

  • June 27, 2010
  • 1 reply
  • 1120 views

Hi

I'm trying to connect CS3 Bridge to my Order Management Database.

Using the examples I'm able to create a Tabbed Palette and show my

PHP Page called from the Webserver.

I would like to achive the following:

Once the user opens a folder, the folder name which includes the ordernumber

should be send to the HTML page and thru jQuery Ajax call to the server.

The Page will then show the order information.

Once the user clicks on one of the rating stars the filename & rating should also

be sent to the HTML page and the page will send it to the server to add the picture to

the order. Similar is he deletes the stars.

Is that possible?If now what is possible?

I'm not so into application scripting, can you provide me further examples for that?

(I'm just looking for examples how to send the folder name,

filename and rating to the HTML page.The rest is not a big deal)

Thanks a lot!

Philipp

This topic has been closed for replies.

1 reply

Participant
June 28, 2010

It is possible. Below some sample code to get your informations from the currently selected Image in Bridge:

var selectedImage= app.document.selections[0];

var filename = selectedImage.spec.name;

var foldername = selectedImage.spec.parent.name;

var taget = new File("cachedThumnail.jpg");

var thumbnail = selectedImage.core.thumbnail.thumbnail;
thumbnail.exportTo(target);

You can access the BitmapData Object of the preview image, but you have to save it to disk, in order to show it on your webpage.

Regards,

Markus

Participant
June 29, 2010

Hi

thanks for your answer that makes it a bit clearer for me.

So as far as I understand that should be standard JS Code.

I creted the following page, which should be able to alert the foldername.

Unfortunately it doesn't work.

Can you give me a hint how this can work?

Thanks a lot!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>TESTPAGE</title>
<style type="text/css">
<!--
body,td,th {
    font-size: 10px;
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
}
body {
    background-color: #000000;
    margin-left: 3px;
    margin-top: 3px;
    margin-right: 3px;
    margin-bottom: 3px;
}
-->
</style>
<script type="text/javascript">
function alertimageinfo(app){
    var selectedImage= app.document.selections[0];

    var filename = selectedImage.spec.name;

    var foldername = selectedImage.spec.parent.name;

    alert(foldername);
}
</script>

</head>
<body>
  <input type="button" title="Get Folder Info" name="go" value="Get Folder Info"
    onClick="alertimageinfo(app)" />
</body>
</html>

Paul Riggott
Inspiring
June 29, 2010

The code mselbach2 has supplied is for Bridge, for your needs look at exifTool by Phil Harvey.

http://www.sno.phy.queensu.ca/~phil/exiftool/