This content has been marked as final. Show 5 replies
But you can run JS in Bride from AS via another Adobe application, for example, InDesign using BridgeTalk.
A couple of years ago I did an experiment in Xcode 2.2. The goal was to create a simple interface with Interface Builder a window with 5 buttons grouped into 2 panels. The buttons have an AS attached to them. And this AS, in turn, triggers a JS from InDesign to Bridge, using BridgeTalk, and sending some parameters in variables. The JS in Bridge writes some metadata and sets label.
To demonstrate the approach Ill post the script in the next post.
Here is my AS script from Xcode project:
Some text is in Russian don't mind it. Most important that this is a working example.
on clicked theObject
if name of theObject is "b1" then
set processName to (StringToUnicode "Начало работы")
set myBridgeLabel to "Red"
set myLabel to 1
else if name of theObject is "b2" then
set processName to (StringToUnicode "Сдано на цв-корр")
set myBridgeLabel to "Green"
set myLabel to 2
else if name of theObject is "b3" then
set processName to (StringToUnicode "Сдано на ДТП")
set myBridgeLabel to "Yellow"
set myLabel to 3
else if name of theObject is "b4" then
set processName to (StringToUnicode "Забрано")
set myBridgeLabel to "Blue"
set myLabel to 4
else if name of theObject is "b5" then
set processName to (StringToUnicode "Пересдано")
set myBridgeLabel to "Purple"
set myLabel to 5
tell application "Adobe InDesign CS2"
set mydocument to active document
set myDocumentPath to full name of mydocument
set workerName to "Сервецкий"
tell metadata preferences of mydocument
set theDate to current date
set myWeekday to weekday of theDate as string
set myDenNedeli to my convertWeekday(myWeekday)
set myRecord to (processName & " " & workerName & " ") & myDenNedeli & " " & text 1 thru -4 of time string of theDate & "
set myHistory to get property namespace "http://ns.adobe.com/photoshop/1.0/" path "History"
set property namespace "http://ns.adobe.com/photoshop/1.0/" path "History" value myHistory & myRecord
tell mydocument to save
tell application "Finder"
set myFile to a reference to file myDocumentPath
set label index of myFile to myLabel
if myWeekday = "Monday" then
else if myWeekday = "Tuesday," then
else if myWeekday = "Wednesday" then
else if myWeekday = "Thursday" then
else if myWeekday = "Friday" then
else if myWeekday = "Saturday" then
else if myWeekday = "Sunday" then
It is strange, but I was unable even to open Bridge's dictionary in Script Debugger: When I was trying to add Bridge, it was 'grayed out'.
It does look like a bug, especially because the exact same command sent to photoshop does work as expected...
Anyway thanks for your input...