The DAM Forum
Welcome, Guest. Please login or register.
April 17, 2014, 12:04:38 AM

Login with username, password and session length
Search:     Advanced search
28003 Posts in 5130 Topics by 2912 Members
Latest Member: kbroch
* Home Help Search Login Register
+  The DAM Forum
|-+  Software Discussions
| |-+  Scripting
| | |-+  Help revising EM2 Annotation script: Description from text lines
« previous next »
Pages: [1] Print
Author Topic: Help revising EM2 Annotation script: Description from text lines  (Read 3008 times)
mtpaper
Newbie
*
Posts: 31


View Profile Email
« on: September 18, 2008, 04:36:33 PM »

I'm new to mac and EM2. I have just enough knowledge to get myself into trouble.

If I understand correctly, the current existing script (titled Annotation: Description from text lines) does the following:
- looks at selected files
- looks at contents of text file
- finds the record in the text file that corresponds to a file
- copies the entire record from text file and writes it to the Description field

I would like to control the placement of the data. Instead of all of it going to Description, I'd like to specify that some of it go to Event, and some to source, some to date created etc.

Is that possible?
Where can I learn the syntax etc?
Do I need to learn Applescript to do this?

In case you need/want the details....
- I have a gazillion faxes from WinFax
- I'm batch converting them to pdfs
- WinFax will create a log file for me, which I'll massage in Excel, so that the first field of each record is the filename, followed by sender's phone number, transmission date, subject
- I am trying to link up the data from the logfile with the pdfs, so that I can catalog this in EM2

....unless someone has a better idea of how to do this??? 

Worse comes to worse, I'll just use the existing script, then search for specific text in the description field only, without having the benefits of the catalog annotation fields....

Thank you!
Marion

PS - I also have windows computers here, so if someone wants to tell me a way to attach the records from the log file to the pdf metadata using acrobat, that would be ok too..... but I think that entails Javascript.  I'm a bit overwhelmed, not knowing whether I need to learn Javascript, Applescript, Automator, or just use the script that's available from EM!
Logged

Marion
mtpaper
Newbie
*
Posts: 31


View Profile Email
« Reply #1 on: September 18, 2008, 09:53:29 PM »

OK - I have it working and will post what I've done here as a reference....

I used a different script, called:  Annotation-DB-names, by Daniel Robillard
http://www.iview-multimedia.com/downloads/scripts.php

I found it by surfing and reading and surfing and reading.... Here's the description of his script:

Open and import a text file (type "TEXT") structured as a database or a spreadsheet. The first line is the identifier of the columns and must contain the names of the annotation fields (IPTC). Each other line begin with the file name of an item followed by the respective values of the fields. The separator is Tab.
An empty value preserves the existing annotation.
A value "-" erases existing annotation.
For the fields in list (Keywords, Categories, People) the separator is "," (comma).
The character "¬" (option-L) is replaced by "return" in the Caption field.

I had to pay attention to the fieldnames I used in my text file, as the script is old and, as David Riecks pointed out, used IPTC IIM fields. But I just kept playing with a test text file, and test pdf files, and seeing where the source data ended up.  For example, my source file has a field called EVENT DATE, which transfers perfectly to DATE CREATED. 

The other thing I had to watch was that Daniel's script uses a hyphen to mean 'delete existing annotation' - and I have lots of hyphens in my data (for phone numbers).  So I'll do a quick search and replace to change phone numbers from ###-###-#### to ###.###.#### and that's easy enough.

But this is such a powerful feeling.... to be able to convert 10 years of WinFaxes to pdfs, and create a catalog for finding and sorting the files.....

G'nite
Marion

Logged

Marion
peterkrogh
Administrator
Hero Member
*****
Posts: 5682


View Profile Email
« Reply #2 on: September 19, 2008, 05:42:49 AM »

Thanks for following up, Marion.
Peter
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!