Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
The code mselbach2 has supplied is for Bridge, for your needs look at exifTool by Phil Harvey.
Copy link to clipboard
Copied
Hi
no I don't think to, bec I'm trying to build a solution in Adobe Bridge which is connected to my
webbased database system. I would like to frame a webpage in Bridge and interact with selected
content of this application.
Philipp
Copy link to clipboard
Copied
I think you will need to look at the Bridge SDK and build / test your code in ExtendScript Toolkit.
The code you are trying is not compatable with Bridge.
I've had a quick look at the SDK and there doesn't seem to be an example of what you want to do.
Copy link to clipboard
Copied
Unfortunally, is's not that easy. You will have to define a set of Javascriptfunctions on the Bridge site and connect them as callbacks to your Window Object in which the webpage is displayed (TabbedPalette is not supported!!! Only dialogs, windows, navbars and the content pane). You put you javascript functions into the jsFuncs property of these objects. from your webpage you can then easily call these functions via
var response = eval(call(functionname, parameters))
But for you even more interesing is the function execJS() of these objects. With this function you can execute javascript functions in the webpage directly from within bridge and supply your fileinformation as parameters.
There is a PDF document in the SDK called "Adobe Bridge CS4 Javascript Guide" where all this explained in detail ("Displaying HTML in a navigation bar").
BUT, i'm not sure if I remember correctly, but I think, I read that this possiblities are no longer supported in CS5. So you better try your luck with flash, which is much better integrated into the suite.
Regards,
Markus
Copy link to clipboard
Copied
Hi
Thanks a lot for your reply.
I played around for a while with all the samples and found out that it might be possible
to extend the "SnpAddScriptUINavBar" to my needs.
(this example is also in C5 available)
Thr problem is that it's just shown in the Navi Area which is useless for me bec I wanna
build something at the side.
Whats a bit confusing is that Adobe writed here that HTML is in CS5 just be shown in
custom Palettes which would be what I need, right?
Unfortunately I have no clue about flash and exspeciall about Server calls like Ajax calls,
HTML and jQuery would be perfect.
My next step is to finish the downloa of CS5 Trial on Windows an look at the SDK examples in CS5.
Thanks a lot.
Copy link to clipboard
Copied
I don't think the Bridge SDK is part of the trial download but you can get it here http://www.adobe.com/devnet/bridge/
Copy link to clipboard
Copied
Hi
Yes you are right it's not part of the trial.
I got the SDK following your link.
BG Philipp