Script to insert file name into keywords field of same file

Hello,
search a solution, a Script or another, which writes the file name into keywords field of same file (Metadata: Description/Keywords) in "photoshop", "bridge" or better in "Lightroom" .
I found this topic from Mike Hale http://www.ps-scripts.com/bb/viewtopic.php?t=1330
It's possible this script to change this in such a way that it does this:
"script to insert file name into keywords field of same file"
Thanks and best greetings
Wolfgang

This works in CS2:-
#target bridge
   if( BridgeTalk.appName == "bridge" ) {
nameDescription = MenuElement.create("command", "AddName to Description", "at the beginning of Thumbnail");
nameDescription .onSelect = function () {
     nameToDescription();
function nameToDescription(){
var items = app.document.selections;
      for (var i = 0; i < items.length; ++i) {
         var item = items[i];   
var m = item.synchronousMetadata;
filenameToDesc(m, item.name.slice(0,-4));
function filenameToDesc(metadata, Description) {
var strTmpl = "name2Desc";
var strUser = Folder.userData.absoluteURI;
var filTmpl = new File(strUser + "/Adobe/XMP/Metadata Templates/" + strTmpl + ".xmp");
var fResult = false;
try
{ if (filTmpl.exists)
filTmpl.remove();
fResult = filTmpl.open("w");
if (fResult) {
filTmpl.writeln("<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"3.1.2-113\">");
filTmpl.writeln(" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">");
filTmpl.writeln(" <rdf:Description rdf:about=\"\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">");
filTmpl.writeln("<dc:description>");
filTmpl.writeln("<rdf:Alt>");
filTmpl.writeln("<rdf:li xml:lang=\"x-default\">"+Description+"</rdf:li>");
filTmpl.writeln("</rdf:Alt>");
filTmpl.writeln("</dc:description>");
filTmpl.writeln(" </rdf:Description>");
filTmpl.writeln(" </rdf:RDF>");
filTmpl.writeln("</x:xmpmeta>");
fResult = filTmpl.close();
metadata.applyMetadataTemplate(strTmpl, "replace");
filTmpl.remove();
catch(e)
{ fResult = false; }
return fResult;

Similar Messages

  • File name into text field

    Is there a way to display the forms file name, into a text field?
    Example: The form's file name is "MyForm.1.01.pdf"
    I would like to display "MyForm.1.01" in a text field on the form.
    If my form is saved and goes up a revision to say "MyForm.1.02"
    "MyForm.1.02" is then displayed in the text field.
    I was thinking, this could be on the pre open event, so that when the form is saved, it would display the new revision when the form is next opened?
    Thanks in advance.

    Hi,
    The following will get the file name:
    this.rawValue = event.target.documentFileName;
    I would put this in the docReady event, as this event fires only once, when the form opens.
    There is a sample here: https://acrobat.com/#d=ZnxO-dlXXFDS0GvYcQk2NQ
    Hope that helps,
    Niall
    Assure Dynamics

  • Importing text file (with file names) into Automator.. is it possible?

    Hello all,
    I have been working with Windows Batch files for my line of work. I have a couple of file names in a text file (a column), which I want to copy from one folder of one hdd to another folder on a different hdd. I have been trying to do this kind of work with a Mac. I already know how you copy and rename files in automator (which isn't difficult, of course) but you have to 'select' the files in the finder first (with get specified items).
    But the only way i see that you can specify items is by selecting them... is there a way to import a text file with all the file names instead of selecting all the file names manually?
    or is there an AppleScript alternative which I can use to import the text file (or just copy into applescript) and run before the query's of copying and renaming the files? I am kind of new to Apple programming.
    The text file looks like this:
    image1.jpg
    image2.jpg
    etc..
    so there has to be a command to: 'goto' a specific folder as well.
    Thanks in advance!

    You can import text files, but if they are just names you will need an additional action to add the source folder path. A *Run AppleScript* action can be used, for example:
    Tested workflow:
    1) *Ask for Finder Items* {Type: files } -- choose the text file containing the names
    2) *Combine Text Files* -- this gets the text file contents
    3) *Filter Paragraphs* { return paragraphs that are not empty } -- skip blank lines
    4) *Run AppleScript* -- copy and paste the following script:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 680; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- add folder path
    add the specified folder path to a list of file names
    input: a list of text items (the file names)
    output: a list of file paths (aliases)
    set output to {}
    set SkippedItems to {} -- this will be a list of skipped items (errors)
    set SourceFolder to (choose folder with prompt "Choose the folder containing the file names") as text -- this is the folder containing the names
    repeat with AnItem in the input -- step through each name in the input
    try
    set AnItem to SourceFolder & AnItem -- add the prefix
    set the end of the output to (AnItem as alias) -- test
    on error number ErrorNumber -- oops
    set ErrorNumber to ("  (" & ErrorNumber as text) & ")" -- add the specific error number
    set the end of SkippedItems to (AnItem as text) & ErrorNumber
    end try
    end repeat
    ShowSkippedAlert for SkippedItems
    return the output -- pass the result(s) to the next action
    end run
    to ShowSkippedAlert for SkippedItems
    show an alert dialog for any items skipped, with the option to cancel the workflow
    parameters - SkippedItems [list]: the items skipped
    returns nothing
    if SkippedItems is not {} then
    set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
    if TheCount is greater than 1 then
    set theMessage to (TheCount as text) & space & " items were skipped:"
    else
    set theMessage to "1 " & " item was skipped:"
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
    if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
    alternate button "Cancel" default button "OK") is "Cancel" then error number -128
    end if
    return
    end ShowSkippedAlert
    </pre>
    5) *Copy Finder Items* { To: _your external drive_ }

  • How to import MP3 with file name into library, rather than tag?

    I've been given a CD with about 200 MP3s of lectures. They are to be listened to in order, and the file names reflect the order number, like "lecture 1", "lecture 2", etc. However, when I drag them all into iTunes, the names in the iTunes library don't include the file names - they are simply "lecture", which I guess must come from a tag in the MP3 file. So iTunes is ignoring the file name and thus I end up with 200 entries in my iTunes library that can't be ordered properly. How can I get it to use the file name when importing?
    Mike

    If you have your iTunes preferences set to keep your iTunes Music folder organized, it's possible that even the file names have changed according to the files' tags. In that case, you'll need to (at least temporarily) disable this option and import the files from your CD again.
    Once you're sure the files have been successfully added to your iTunes library and the file names kept intact, you can use the Filenames to Song Names script from Doug's AppleScripts for iTunes.
    This should get everything sorted out.

  • Linux file name into ODI variable

    Hello All,
    I have a situation where we have files in one directory in linux ,I want to import the file name into a ODI variable.
    Ex : A_B_C_2014_01_20.zip (inside this zip file are the flat files with data) is the file name in /u02/source_files location , i want this into a ODI variable and once the data loading is complete ,i want to log it saying
    A_B_C_2014_01_20.zip complete
    A_B_C_2014_01_21.zip complete.
    So my other shell script will look for the complete flag and copy the next file into the ODI pick up location.In this case I need to pick up A_B_C_2014_01_22.zip and start the data loading.
    How do i implement this functionality in ODI. Please let me know.

    Issue was due to a syntax error. Case closed.
    Thanks!
    -OS

  • Method for quickly putting file names into IPTC core description?

    I would like to put the file names into the IPTC core description. The files are all named differently .Is there a way to batch this or any other way of automatically including it so that I don't have to do each file separately? Or perhaps there is a plug in?
    I am using PS5/ bridge on a mac.

    You only need a script… not a plug-in to do this. Search the bridge scripting forum as Im sure Paul has posted several variations of scripts that do this…

  • How to insert a value into a field of binary type?

    I've been using Oracle for a while now but never dealt with BLOB
    or long raw type before. Does anyone here know how to insert a
    record into a field of either blob or long raw type?
    Any suggestions would be very appreicated.
    Thanks.

    pls used the loadfromfile procedure which is in the DBMS_LOB
    package to insert the data from external os file into blob data
    type column.
    Kunjan

  • Get the file name into a Odi variable

    Hi,
    I need to get the file name into odi variable like ..A/ETC/file.txt
    For eg.the filename file.txt should get store in a variable.
    Then i want to compare the file name stored in the variable with some other value.
    Please suggest.
    Thanks.

    in package,
    declare the variable, then evaluate it with another variable, generally using # syntax
    if the variable is date type, suggest to use : syntax, because # will treat the variable value as text value
    in loadplan
    use case when syntax,

  • Load Source File Names into Recordset Object

    Hi,
    I have a folder with abc.txt, xyz.txt, pqr.txt etc files.
    My requirement is to load all the file names into a Record Set which I need to use in data flow.  I think I need to use For each loop container with Enumerator as 'Foreach File Enumerator' and in the variable mappings I have added a variable name
    to get the file name. But I have stuck how to add these file names to a Record Set target. Please help me.
    Thanks.

    Hi Amaya14,
    Go these this link Click Here
    Thanks

  • Sharepoint Workflow : how to get document full path + file name into variable?

    Hi,
    Anybody knows how to get document full path + file name into a variable in Sharepoint 2010 workflow?
    Example http://sp1:80/InvoiceQueue/Shared Documents/123.pdf
    I am using List Workflow which links to a document library.

    Hi SAMSUNG,
    According to your description, my understanding is that you want to get the full path of a document in a list workflow.
    You can set the variable to the Enconded Absolute URL of the document. The screenshot is my testing. In my testing (in the red area), when the title of a document was equal to the tile of the current item, set a variable to the Enconded Absolute URL of the
    document. I used ‘Log to history list’ to check the value of the variable in Workflow History .
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Cannot insert Chinese character into nvarchar2 field

    I have tested in two environments:
    1. Database Character Set: ZHS16CGB231280
    National Character Set: AL16UTF8
    If the field type of datatable is varchar2 or nvarchar2, the provider can read and write Chinese correctly.
    2. Database Character Set:WE8MSWIN1252
    National Character Set: AL16UTF8
    The provider can not read and write Chinese correctly even the field type of datatable is nvarchar2
    I find that for the second one, both MS .NET Managed Provider for Oracle and Oracle Managed Data Provider cannot read and write NCHAR or NVARCHAR2 fields. The data inserted into these fields become question marks.
    Even if I changed the NLS_LANG registry to SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280, the result is the same.
    For the second situation, only after I change the Database Character Set to ZHS16CGB231280 with ALTER DATABASE CHARACTER SET statement, can I insert Chinese correctly.
    Does any know why I cannot insert Chinese characters into Unicode fields when the Database Character Set is WE8MSWIN1252? Thanks.
    Regards,
    Jason

    Hi Jason,
    First of all, I am not familiar with MS .NET Managed Provider for Oracle or Oracle Managed Data Provider.
    How did you insert these Simplified Chinese characters into the NVARCHAR2 column ? Are they hardcoded as string literals as part of the SQL INSERT statement ? If so, this could be because, all SQL statements are converted into the database character set before they are parsed by the SQL engine; hence these Chinese characters would be lost if your db character set was WE8MSWIN1252 but not when it was ZHS16CGB231280.
    Two workarounds, both involved the removal of hardcoding chinese characters.
    1. Rewrite your string literal using the SQL function UNISTR().
    2. Use bind variables instead of text literals in the SQL.
    Thanks
    Nat

  • File name into document

    Is there a way to create a master doc page that automatically imports the current document file name into a desired location?

    Perhaps a text variable of the filename on the master? Look this up in the help.
    Mike

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

  • I have a question about extracting pages.  When I do the function, adobe saves the individual files as " file name space page number ", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I a

    I have a question about extracting pages.  When I do the function, adobe saves the individual files as "<file name><space><page number>", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I am using excel to concatenate some data to dynamically build a hyperlink to these extraced files.  It casues me problems, however, for the space to be the the file name.  Is there any way to change the default behavoir of this function to perhaps use a dash or underscore instead of a space?

    No, you can't change the default naming scheme. You can do it yourself if you extract the pages using a script instead of using the built-in command.

  • Setting up the File Name of email Attachment from Received File Name

    Hello All,
    I have to send the Received File in attachment to an Email if there is any exception. Here I can attach the file, but I cannot set the file name of attachment as the Received File Name. Is there anyway of doing this without using custom pipeline component.
    Here I am using the Orchestration and SMTP Adapter.Any help is greatly appreciated.
    Thanks

    It might work if you use a custom pipeline component on your send port and in the Execute method populate the MIME.FileName property of the body part.
    Something like:
    public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
    string filename = inmsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
    inmsg.BodyPart.PartProperties.Write( "FileName", "http://schemas.microsoft.com/BizTalk/2003/mime-properties", "filename);
    return inmsg;
    You can take reference from similar post here
    SMTP - Setting attachment filename
    Anther good article with MIME is here
    Setting attachment filename with the SMTP Adapter
    For MIME case your SMTP message construct statement would be like below
    multipartMessage.MessagePart_1= InMSG;
    multipartMessage.MessagePart_2="This is message part2 as a string";
    multipartMessage(SMTP.Subject) ="Email From Dynamic Port";
    multipartMessage(SMTP.From) ="[email protected]";
    multipartMessage(SMTP.SMTPHost) ="yoursmypserver.com";
    multipartMessage.MessagePart_2(MIME.FileName) = "Attachment_Name";
    multipartMessage(SMTP.SMTPAuthenticate) =0;
    Thanks
    Abhishek

Maybe you are looking for

  • Upgrade an iMac G3 to Panther or Tiger?

    Hello - I'm upgrading my parents iMac DV G3/400 (firewire, DVD drive). I have ordered 512MB memory stick to augment the iMac's original 64MB. I'm going to install OS X, but I'm not sure if Tiger or Panther will be a better choice. I have access to a

  • How to make an ipad recognize a new user

    I gave my ipad 1 to my sister. I created an apple id for her already. How do I delete my account in the ipad and make it recognize my sister as its new owner?

  • Ebedded mp3 within a symbol - can't get it to stop???

    Hello I have a layer in flash that has 3 different keyframes containing 3 different symbols. Each symbol has a sound keyframe within, which plays when I preview the file. The sound keeps playing even when the playhead reaching the main keyframe on sy

  • Negotiating a port number from the OS

    All the socket classes require a port number to be specified. No problem, except as one of the requirements at work, I need to make a server that negotiates with the OS to receive a free port number. I can not hard code any numbers or receive them fr

  • Milestone

    Dear Frnds I had posted this query earlier but there were n responses....so one more attempt I am using milestone billing ...where we generate down payment requests at regular intervals..............i would like to knw how I should be using condition