Script to read IPTC description
Hi,
i need a script so that i can read the description field of the IPTC core of a selected file (and also preferabely the ability for selection of files) in bridge (in my case CS4)
and also please introduce some string manipulation functions to apply to the read field.
Thanks in advance.
This will write the selected documents description field to the console in the ExtendScript Toolkit.
You will have to be more precise on what you want to do with the string to be able to give an example.
#target bridge
loadXMPLibrary();
for(var a in app.document.selections){
var thumb = app.document.selections[a];
if(thumb.hasMetadata){
var selectedFile = thumb.spec;
var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
var myXmp = myXmpFile.getXMP();
for(var i = 1;i <= items;i++){
var Desc = ArrayItems(XMPConst.NS_DC, "description");
$.writeln(Desc);
unloadXMPLibrary();
function loadXMPLibrary(){
if ( !ExternalObject.AdobeXMPScript ){
try{
ExternalObject.AdobeXMPScript = new ExternalObject
( 'lib:AdobeXMPScript' );
}catch (e){
alert( ErrStrs.XMPLIB );
return false;
return true;
function unloadXMPLibrary(){
if( ExternalObject.AdobeXMPScript ) {
try{
ExternalObject.AdobeXMPScript.unload();
ExternalObject.AdobeXMPScript = undefined;
}catch (e){
alert( ErrStrs.XMPLIB );
function ArrayItems(ns, prop){
arrItem='';
var items = myXmp.countArrayItems(ns, prop);
if(items > 0){
for(var i = 1;i <= items;i++){
arrItem += myXmp.getArrayItem(XMPConst.NS_DC, prop, i);
return arrItem;
Similar Messages
-
If Open File Has an Open Clipping Path-Add IPTC Description
Hello,
Just looking for any pointers. If I have an image open, I want to run a script that will check the top path(or selected path) for any open points. If it is an open path, add "open path" in the IPTC/Description.
I can not figure this out. Any help would be greatly appreciated.Nevermind with the problem file link. It was a stupid error on my part. The loop that checks the subpaths was only checking
subPathItems[0]( the first subpath instead of subPathItems[s] ( all subpaths ).
var selectedPathIndex = activePathIndex();
if( selectedPathIndex==-1){
var targetPath = app.activeDocument.pathItems[0];
}else{
var targetPath = app.activeDocument.pathItems[selectedPathIndex];
if(!isPathClosed( targetPath )) app.activeDocument.info.caption = "Open Path";
function isPathClosed( p ){
for(var s = 0;s<p.subPathItems.length;s++){
if(!p.subPathItems[s].closed) return false;
return true;
function activePathIndex(){
try{
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet( ref );
return desc.getInteger(charIDToTypeID("TrgP" ));
}catch(e){} -
I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.
I don't want it to be an EEM Event, I just want to run it from the (tcl)# prompt.
So I guess I'm asking if you can use cli_exec and other commands in the "namespace import ::cisco::eem::*" in a normal non-EEM script - can I do that?
This is the error I get:
OTN.159(tcl)#source flash:TCL_SNMP_Remote_Read.tcl
invalid command name "::cisco::eem::event_register_none" ^
% Invalid input detected at '^' marker.
What am I missing?
================= TCL_SNMP_Remote_Read.tcl ==============================
::cisco::eem::event_register_none
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
if [catch {cli_open} RESULT]
{ error $RESULT $errorInfo }
else { array set cli1 $RESULT }
if [catch {cli_exec $cli1(fd) "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0" } RESULT]
{ error $RESULT $errorInfo }
else { set SnmpSysDesc $RESULT }
if [catch {cli_close $cli1(fd) $cli1(tty_id)} RESULT] {
error $RESULT $errorInfo
puts $SnmpSysDesc
=========================================================================
In the sho-run config I have:
event manager directory user policy "flash:/"
event manager session cli username "cisco"
Any help to get me started would be greatly appreciated!
TimIf you don't want an EEM policy, then don't use any of the EEM constructs. Instead, all you need is this:
set output [exec "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0"]puts $output -
Shell scripts to read data from a text file and to load it into a table
Hi All,
I have a text file consisting of rows and columns as follows,
GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005675 000001 000000 000000 000000 000000 000000 000001 My requirement is that, i should read the first 3 columns of this file using a shell script and then i have to insert the data into a table consisting of 3 rows in oracle .
the whole application is deployed in unix and that text file comes from mainframe. am working in the unix side of the application and i cant access the data directly from the mainframe. so am required to write a script which reads the data from text file which is placed in certain location and i have to load it to oracle database.
so I can't use SQL * loader.
Please help me something with this...
Thanks in advance.1. Create a dictionary object in Oracle and assign it to the folder where your file resides
2. Write a little procedure which opens the file in the newly created directory object using ULT_FILE and inside the FOR LOOP and do INSERTs to table you want
3. Create a shell script and call that procedure
You can use the post in my Blog for such issues
[Using Oracle UTL_FILE, UTL_SMTP packages and Linux Shell Scripting and Cron utility together|http://kamranagayev.wordpress.com/2009/02/23/using-oracle-utl_file-utl_smtp-packages-and-linux-shell-scripting-and-cron-utility-together-2/]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
How can I script Adobe Reader updates using vbScript, PowerShell or C#?
I would like to script Adobe Reader updates using vbScript, PowerShell or C#, are there any Adobe API calls I use to do this. There are several different version that I support and auto update is not an option. I do updates at a specific time of the month. I would like to write a script that would download and install the update for the currently installed version of Adobe Reader (32 or 64 bit) for the version of the OS (32 or 64bit). I can detect the OS version and the Adobe version. I can download updates but I do not want to hard code anything
Sabian is correct.
Most admins download the updates from the ftp site and push via AIP, GPO, SCCM, or some other method whenever it makes sense for them.
Ben -
Amending script to read list of computers, run script and output to log file
Hello all,
I have cobbled together a script that runs and does what I want, now I would like to amend the script to read a list of computers rather than use the msg box that it is currently using for the strcomputer, if the computers doesn't respond to a ping, then
log that, if it does continue with the script and when it is complete, log a success or failure. I have just started scripting and would really appreciate some help on this one,thanks. I created the script to fix an SCCM updates issue and failing task sequences,
so it may prove useful to others.
There are msg box entries that can be removed that were originally in there for the user running the script.
'setting objects
Dim net, objFSO, shell
Dim objFile, strLine, intResult
Set objnet = CreateObject("wscript.network")
Set objFSO = CreateObject("scripting.filesystemobject")
Set objshell = CreateObject("wscript.shell")
strfile = "c:\wuafix\wuafix.vbs"
strUser = "domain\user"
strPassword = "password"
'getting server name or IP address
strComputer=InputBox("Enter the IP or computer name of the remote machine on which to repair the WUA agent:", "Starting WUA Fix")
'check to see if the server can be reached
Dim strPingResults
Set pingExec = objshell.Exec("ping -n 3 -w 2000 " & strComputer) 'send 3 echo requests, waiting 2secs each
strPingResults = LCase(pingExec.StdOut.ReadAll)
If Not InStr(strPingResults, "reply from")>0 Then
WScript.Echo strComputer & " did not respond to ping."
WScript.Quit
End If
'Check if source file exists
If Not objFSO.FileExists(strFile) Then
WScript.Echo "The source file does not exist"
WScript.Quit
End If
MsgBox "The WUA Fix is in process. Please wait.", 64, "Script Message"
'mapping drive to remote machine
If objFSO.DriveExists("Z:") Then
objnet.RemoveNetworkDrive "Z:","True","True"
End If
objnet.MapNetworkDrive "Z:", "\\" & strComputer & "\c$", True
'creating folder for install exe on remote machine
If (objFSO.FolderExists("Z:\wuafix\") = False) Then
objFSO.CreateFolder "Z:\wuafix"
End If
'copying vbs to remote machine
objFSO.CopyFile strFile, "Z:\wuafix\wuafix.vbs"
'set command line executable to run a silent install remotely
strInstaller1 = "cscript.exe c:\wuafix\wuafix.vbs"
'strInstaller2 = "c:\wuafix\wuafix.vbs"
strExec = "c:\pstools\PsExec.exe "
'objshell.Run strExec & " \\" & strComputer & strInstaller1
On Error Resume Next
result = objshell.Run(strExec & " \\" & strComputer & " " & strInstaller1)
If Err.Number = 0 Then
WScript.Echo "PSXEC Runing WUA fix remotely"
Else MsgBox Err.Number
MsgBox result
End If
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'Application' AND " _
& "EventCode = '4'")
Wscript.Echo "Event Viewer checked and Fix Applied:" & colLoggedEvents.Count
MsgBox "Removing mapped drive Please wait.", 64, "Script Message"
If objFSO.DriveExists("Z:") Then
objnet.RemoveNetworkDrive "Z:","True","True"
End If
MsgBox "The WUA Fix has been applied.", 64, "Script Message"
quit
wscript.quit
Any help appreciated and explanations on the process would be great as I would like to learn the process involved, which is difficult when working during the day.
many thanksHi Bill,
long story short, I have approx. 2800 clients with an old entry in WMI for updates that the sccm client cannot clear or run because they do not exist anymore, so the client will not run updates or use a task sequence because of this, so my script fixes this
and does a couple of other things, I have found another way to do this by running a different script that uses WMI to call a cscript function that uses the wuafix.vbs that is coped to the machine, I am also changing the echo entries to output to a log
file instead so that I can track what client has run the fix andn which ones haven't.
If you have any suggestions then please let me know, nothing nefarious :)
many thanks -
Need a VB-Script that read a txt-file and only the lines that are new since last time
Hi,
I need help to write a VB script that read all new lines since the last time.
For example: The script reads the textfile at specific time, then 10 minutes later the script read the file again, and it should now only read the lines that are new since last time. Anyone that has such a script in your scriptingbox?
cheers!
DocHo
DocBased on the excellent idea by Pegasus, where is a VBScript solution. I use a separate file to save the last line count read from the file, then each time the file is read I update the line count. Only lines after the last count are output by the program:
Option Explicit
Dim strFile, objFSO, objFile, strCountFile, objCountFile, strLine, lngCount, lngLine
Const ForReading = 1
Const ForWriting = 2
Const OpenAsASCII = 0
Const CreateIfNotExist = True
' Specify input file to be read.
strFile = "c:\Scripts\Example.log"
' Specify file with most recent line count.
strCountFile = "c:\Scripts\Count.txt"
' Open the input file for reading.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFile, ForReading)
' Check if the line count file exists.
If (objFSO.FileExists(strCountFile) = False) Then
' Initial count is 0, so all lines are read.
lngCount = 0
Else
' Open the line count file.
Set objCountFile = objFSO.OpenTextFile(strCountFile, ForReading)
' Read the most recent line count.
Do Until objCountFile.AtEndOfStream
lngCount = CLng(objCountFile.ReadLine)
Loop
End If
' Read the input file.
lngLine = 0
Do Until objFile.AtEndOfStream
' Count lines.
lngLine = lngLine + 1
strLine = objFile.ReadLine
If (lngLine >= lngCount) Then
' Output the line.
Wscript.Echo strLine
End If
Loop
' Close all files.
objFile.Close
If (lngCount > 0) Then
objCountFile.Close
End If
' Ignore last line of the file if it is blank.
If (strLine = "") Then
lngLine = lngLine - 1
End If
' Save the new line count.
Set objCountFile = objFSO.OpenTextFile(strCountFile, _
ForWriting, CreateIfNotExist, OpenAsASCII)
objCountFile.WriteLine CStr(lngLine + 1)
objCountFile.Close
Richard Mueller - MVP Directory Services -
Need help creating a script to read the name of a folder (which is the AD Username) and adding that name into the permissions of that folder.
I have over 100 folders which I need to add the AD user to read and write to their own folder
Hope you guys understand what I meanJust to add, Mac in intergrated into AD and all I need is help in creating the script
Thanks -
What can I use font book for? I read the description but still don't get it. Does it contain fonts that are not already installed on my new Mac? Thanks.
Disabling (turning off) a font will make it unavailable for use in any font menu. You can alwasy enable the font(s) again - they're not gone permanantly. DON'T disable System fonts, though -> that's just asking for trouble.
Here's -> https://www.youtube.com/watch?v=JdR6-4lnF5A - a good video tutorial about using Font Book.
Clinton -
I was wondering if it's at all possible to read the description of videos that you have on your iPod Touch 4th or 5th Generation. It's available on iTunes, but I was wondering if there was a way to see it on your actual device.
Any answer would be a great help! ThanksYou can omit the title altogether in the URL (together with the succeeding slash, of course). For example, my own podcast URL in the Store is
https://itunes.apple.com/gb/podcast/the-sound-of-78s/id166389425?mt=2
but this works perfectly well:
https://itunes.apple.com/podcast/id166389425
Indeed you can even put your own title:
https://itunes.apple.com/podcast/any_old_title/id166389425
So it's as simple as that! -
How can I name a button/movie so that an external script can read it?
Hi,
I have a javascript on my website that is called on any click. The script reads the name of the clicked item. This works fine for all jpg/gif images with a name, but how can I name a flash movie in such a way that this script can read it? I tried several things, the name (and id) in the published parameters, the name of the instance, of the button, etc. But nothing works?
The external javascript is this:
var theName;
function grabName(e){
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) {targ = targ.parentNode;}
theName=targ.name;
if(theName){GoogleCounter(theName);}
document.onclick=grabName;
Thanks,
IreneYou should look into using the ExternalInterface class to have Flash talk to javascript in the web page that contains it. Here's a link that provides some information on that...
http://kb2.adobe.com/cps/156/tn_15683.html -
Importing IPTC Description to Lightroom 4
How do I import the IPTC "Description" field into Lightroom 4 from the 7000+ metadata of photos I worked with in Bridge (CS4)?
There's a "Save to SD" command in the menu. The tracks are exported to the
MyTracks folder in the root of your SD card.
Sent from phone.
În data de 10.09.2012 16:02, "Harvedit" <[email protected]> a scris:
Re: Importing track log to lightroom 4 created by Harvedit<http://forums.adobe.com/people/Harvedit>in
Photoshop Lightroom - View the full discussion<http://forums.adobe.com/message/4686545#4686545 -
IPTC description got lost - a bug?
Hi folks,
recently I started to use LR (2.5, 64bit version) to also edit my IPTC fields (only the RAW files, Nikon in my case) and unfortunately I ran into trouble doing so.
After I had finished the whole image and IPTC work I moved the image files and their related XMP files (which include the whole text related metadata) to another hard drive, my "finished work" hard drive. This part of the workflow did never make any trouble with the IPTC stuff, as long as I did not use LR for that. What has happened:
This morning, when I started my PC (Intel Quadcore and XP Prof. 64bit) and opened LR I agreed to first save the catalog, as I always do. And all the IPTC description fields of all the moved RAW-files are completely empty (and the information is missing in the XMP files as well), only the description fields!
Is there still a misconception between what the LR database stores and what and when this is available in the XMP files?
Anyway, for me this seems to be bug!
This will cost me about 2 additional hours to recover the missing IPTC descriptions from a TIFF selection I made out of the finished RAW files, yesterday.
Knowing that there is a time gap between what's stored in the LR database and what and when it is available in the XMP files,
I always have set the LR catalog settings to "save changes automatically to XMP". Additionally, I regularly save the metadata settings by doing so manually ("STRG+S, or choosing "save metadata to file"), at least once a day or after major sessions. Anyway, this did not help in this case.
Anybody out there having an idea about the what and why on the problem above?
Thanks a lot in advance
ThomasHi dj_page,
thanks for your efforts. And here are my answers to your questions:
1. are you sure you have write access to the folder on your hard disk where the .xmp file is located?
Full access.
2. How are you moving these files to the 2nd hard drive ... Lightroom or Windows?
Windows. (I am always doing it this way. Btw, I am using Windows' tool robocopy to incrementally backup all my image files. Robocopy has proven to be absolutely reliable).
3. Before you move, does Lightroom show the message in the Metadata panel that the files re up to date?
Mmh, what exaclty do you mean by "re up to date"?
I usually do an additional manually "save metadate to file", to be sure (!) that the last metadata upadates are in the XMPs.
Kind regards
Thomas -
How do you go back to IPTC/description, ect in file info
Hi ,
I am in this view of file info and need to go back to the very first view, IPTC, description, ect, current view shows GPS data, video data.
ThanksKeys for navigating a PDF
Shortcut
Windows
Mac
Previous screen
Page Up or Shift+Enter
Page Up or Shift+Return
Next screen
Page Down or Enter
Page Down or Return
First page
Home or Shift+Ctrl+Page Up or Shift+Ctrl+Up Arrow
Home or Shift+Command+Up Arrow
Last page
End or Shift+Ctrl+Page Down or Shift+Ctrl+Down Arrow
End or Shift+Command+Down Arrow
Previous page
Left Arrow or Ctrl+Page Up
Left Arrow or Command+Page Up
Next page
Right Arrow or Ctrl+Page Down
Right Arrow or Command+Page Down
Previous open document
Ctrl+F6 (UNIX)
Command+F6
Next open document
Shift+Ctrl+F6 (UNIX)
Shift+Command+F6
Scroll up
Up Arrow
Up Arrow
Scroll down
Down Arrow
Down Arrow
Scroll (when Hand tool is selected)
Spacebar
Spacebar
Zoom in
Ctrl+equal sign
Command+equal sign
Zoom out
Ctrl+hyphen
Command+hyphen -
Where can I read the description?
Hello,
when I synchronize a E61 with 6.86.9.3 with outlook and have a look in the Synch protocol, I see that the description of a task ("Aufgabe" in German version) will transferred to and from my mobile.
But where can I read the description in the phone? I didn't find any menu entry wich does show me it.
Regards,
KurtHi
Which handset you are using? Have you checked this ( for example if it is today) you can check the same in calender or have checked in any notes on your phone ( Menu - Office - Notes) .... I am not sure is it the same u r expecting ? No clues w/o phone model ?
Maybe you are looking for
-
Hi Folks, I would like to display the Y-axis labels of a column chart in Kilo, Millions etc. I used the below mentioned formula in excel for that set of data. Here is the formula [>=1000000]0,,"M";[>=1000]0,"K";0 Though in embedded excel it displays
-
My MacBook Pro won't support disk
I have a disk with medical information. My MacBook Pro will not support this disk? What can I do?
-
I have created an HTML thumbnail page with 12 thumbnails. When I click on a thumbnail I would like it to take me to SV. Do I have to create 12 different SV galleries for each thumbnail? EX: I have a project of an identity so I click on a thumbnail a
-
How to activate Mac OS Text Presets in Firefox?
In the Mac OS under System Preferences→ Language & Text, you can set text presets. As I do a lot of web support work with Firebug, I have a list of presets that expand when I type.Things like -> becoming → or <c> becomes <code>. I cannot for the life
-
SAP Strategy management7.0
Iam working on SSM Pilot Application Server.for joining two tables iam using the join condition but iam getting an error please can somebody help me out in finding answer to this qes. " how to fetch data from 2 or more than 2 tables in SSM. Join stat