Script to add description and keywords to files from text file
Can anyone write something up for me? I will admit I cannot do it myself, I do not know Javascript.
I need to add keywords and a description to 1000's of images. I have a text file formatted as such for each 100 images. The script would need to ask for an input file (or I can hardcode the path into the script) and then apply to the current folder of images shown in bridge.
Text file example:
1000 - Bright Sunset Over City. (sun;city;sky;mountain;) .
1001 - Dawn Behind Mountain And Lake. (sun;mountain;water;sky;) .
1002 - Bright Red Sunset, Light Edged Clouds. (sun;sky;tree;clouds;) .
1003 - Tree Framing Sunset Over Bay. (tree;sun;lake;bay;) .
1004 - Sun Behind Gull On Pilings. (seagull;sun;sea;pilings;) .
images are named 1000.tif, 1001.tif, 1002.tif etc
Running on a Mac with CS3 and CS4.
Thanks,
Chris
Hi Paul,
This is nice example, but your script incorrectly sets both dc:description and dc:subject as ordered arrays. Description should be an alt-text type property, and subject is an unordered array (or 'bag'). Some software might not tolerate the incorrect XMP data types.
Here's an example showing the wrong and write way to set these two properties using the XMP Script API:
// load the library
if (ExternalObject.AdobeXMPScript == undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var Desc = "Test Description";
var Keys = ["One","Two","Three"];
// The wrong way to set the Description. and Keywords...
var bogusXmp = new XMPMeta();
bogusXmp.appendArrayItem(XMPConst.NS_DC, "description", Desc, 0,XMPConst.ARRAY_IS_ORDERED);
for(var s in Keys){
bogusXmp.appendArrayItem(XMPConst.NS_DC, "subject", Keys[s], 0,XMPConst.ARRAY_IS_ORDERED);
$.writeln( bogusXmp.dumpObject() );
// The correct way to set the Description and Keywords
var correctXmp = new XMPMeta();
correctXmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", Desc );
for(var s in Keys){
correctXmp.appendArrayItem(XMPConst.NS_DC, "subject", Keys[s], 0,XMPConst.PROP_IS_ARRAY);
$.writeln( correctXmp.dumpObject() );
Thanks,
David
Similar Messages
-
Read and average n data from text file
I acquire numeric data from the oscilloscope [reading a waveform] that is stored in one column in a text file.
I need to read in selectable amount of data points to average/plot them.
So basically I wanna have a text file with millions of data points but I wanna plot say only every 1000. data point. I have tried many things I found here on the forum but as I am new to LabView, none of them really worked.
Does anybody have a suggestion.
Thanks.
Solved!
Go to Solution.Hi,
among others I have tried to build the VI below but somehow I cannot get to the desired solution because according to the indicators it always stops after the first loop.
Can you have a look please?
Thanks.
Attachments:
read_and_average.vi 13 KB -
Extra/Notes/ linking to video from Text files
With this new build release January 10 2006, I was wondering if the Notes engine found in the iPod Video had been updated to support "links to video files" from text files in Notes.
If yes, what is the tag?
Thnx!
JFLooks like the Notes engine released when the iPod Video was shipped in October 2005 did not have any built-in support to link assets such as Images and Video.
Apple would need to add tags to support video and image linking in the Notes engine.
Does anyone knows when we should expect this fix to happen? -
Set a timeout for "read from text file"
I Need to read from a text file on a remote pc and use the read from text file function to do this. It wotks but sometimes this pc is down causing long wait times in my vi.
Is there a way to set a timeout for the read from text file function, or is there an other solution?
Thank youYou could check that the path is valid first before you attempt to read the file. hen put the file read in a True-False case structure based on the results of the check. You can use the function "Check if File or Folder Exists" It checks whether a file or folder exists on disk at a specified path. This VI works with standard files and folders as well as files in LLB files. The function is found in the File I/O --> Advanced File Functions palette.
Tom -
Saving ai file with title, description and keywords to jpg
Hi,
Is ther a way to save an ai file to eps and jpg including the document title, the description and keywords in the xmp file info?
JPDHi,
I was wondering if I can get the Description and keywords from an ai file
then
add theese to a created jpg or eps with something like this:
---snip SaveForStocks-10.js version 1.1 ---
// Export as a jpg
targetFile = new File(destFolder + '/' + name1);
Doc.exportFile( targetFile, fileType, jpgExportOpts );
--- snip---
---snip http://forums.adobe.com/thread/478694?tstart=60 --
#target bridge
addNametoMeta = {};
addNametoMeta.execute = function(){
var sels = app.document.selections;
for (var i = 0; i < sels.length; i++){
var md = sels[i].synchronousMetadata;
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
var Name = decodeURI(sels[i].name).replace(/\.[^\.]+$/, '');
md.Keywords = md.Keywords + ";" + Name;
----- snip---- -
Room for Description and Keywords input
I am using Bridge CS5 to add bulk and individual photo description and keywords.
Like CS4, room to enter text is too small. If the text reaches the end of the line, the next one remains hidden until I manually click on the left of the text space and drag bottom.
Is there a way to solve this issue?
Thank youDaan,
Sorry for the oversight.
[url http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/document.html]Tag documentation for af:document says that af:document has a facet called "metaContainer" which emits the meta tags. I didn't see any examples or have time to test, but you can certainly try putting the meta tags in that facet.
Update: all of the examples I can find show how to inject javascript into the metacontainer, but it should give you an idea how to do it for <meta> tags. [url http://www.oracle.com/technology/products/jdev/tips/fnimphius/increase_css_and_javascript_performance.html?_template=/ocom/print]Here'surl one such example I found via Google.
Best,
john -
Description and keywords meta tags
Hello,
Could you tell me if it's possible to create HTML output of an ADF page, that has "description" and "keywords" meta tags in the head? Something like:
<meta name="keywords" content="adf jdeveloper description keywords meta tags">
<meta name="description" content="This is a short description of text on a imaginary page">
I know the SEO results may not be great, but I'd still like to use it, just to make it as good as possible for search engines.
Greetings,
Daan HornDaan,
Sorry for the oversight.
[url http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/document.html]Tag documentation for af:document says that af:document has a facet called "metaContainer" which emits the meta tags. I didn't see any examples or have time to test, but you can certainly try putting the meta tags in that facet.
Update: all of the examples I can find show how to inject javascript into the metacontainer, but it should give you an idea how to do it for <meta> tags. [url http://www.oracle.com/technology/products/jdev/tips/fnimphius/increase_css_and_javascript_performance.html?_template=/ocom/print]Here'surl one such example I found via Google.
Best,
john -
Download File thru Text file and add password to protect text file
Hello ABAPers,
I have a problem regarding downloading of file in text file with password...meaning I need to protect with password the text file i created without human intervention...is it possible to ABAP? im using FM GUI_DOwnload and save it to text file.
Please Help...Will reward points ...
Thanks in advance.
aVaDuDzHi
You could use OLE to integrate SAP with Excel - create files, execute macros etc. (search for DOI on SAP help), but this will only work on the presentation server, so you couldn't run it as a service in background. I suppose your e-mails are sent through the internet, hence the requirement for encryption -- or maybe your client doesn't trust its network people! For this you really should use strong encryption -- anything less, you might as well send plain text. One solution to this would be to send the email down a VPDN -- this would encrypt all traffic between source and destination. Another would be to encrypt the file just before it is attached to the email. This could be done within ABAP, but perhaps a third party public key encryptor would be better placed. This could be invoked via a system command call, or as an RFC. A third solution would be to have your mail server handle the encryption.
Heres the link for the above explaination
http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_gci1037837,00.html?track=sap805s
One more link
<a href=" http://www.telfordpct.nhs.uk/healthcare_professionals/SAP/creating_sap_documents_in_word_copy(1).htm ">http://www.telfordpct.nhs.uk/healthcare_professionals/SAP/creating_sap_documents_in_word_copy(1).htm</a>
Regards
Raj
Message was edited by:
Rajasekhar Dinavahi -
SIU - Apply Computer Name and Local Hostname settings from a file
I am setting up a workflow to image corporate computers and wanting to know how the "Apply Computer Name and Local Hostname settings from a file" works in the Apply System Configuration Settings task.
We bind the computer to AD and OD and we have a specific naming convention for certain departments and trying to automate the entire imaging process.
Would this be something that can be done with SIU?Well, maybe there's a bug in the latest version (10.5.3) of SIU as this is not what is happening.
It doesn't seem to matter what I specify for the name parameters I end up with a Bonjour name of ".local".
I put in a line of the form <Mac Address><TAB>tom<TAB>dick<TAB>harry into the text file used by the Apply System Configuration Settings Action.
and end up with hostname = tom, Computer Name = dick and Bonjour Name = .local
I'm building the NetInstall image on a new iMac running 10.5.3 booted out of a second partition and create the image from the main boot partition (also 10.5.3). I then copy the image to my server (10.5.3) and make a second iMac boot up from the NetInstall image.
For what it is worth the Workflow Actions I am using are:
Define Image Source
+ NetInstall
Source: Macintosh HD
Filter Clients by MAC Address
+ Allow
<List of MAC Addresses>
Enable Automated Installation
+ On Volume Named: Macintosh HD
+ Erase before installing
+ Primary Language: English
Apply System Configuration Settings
+ Apply Computer Name and Local Hostname settings from a file: <FILE>
Add Packages and Post-Install Scripts
+ Shell Script [Doesn't work - we're discussing in it in another thread]
Create Image
In: Public
Named: NetInstall Classroom
Volume Name: Classroom iMacs
Index: 1 -
Creating 2D Array with info from file and Saving it to a text file
what im trying to do is take my nice little data structure and put it into a 2D array which i can copy and paste as code into my compiler... it takes TDPoints(like Point2D except has z value) which are in Faces(an arraylist of points, each face also has a color value), which are in objects(arraylist of faces, + other attributes)
for my sake im only working with one object, here is my code:
private void saveArrayToTXT(String name) throws IOException
double X;
double Y;
double Z;
FileOutputStream xos = new FileOutputStream("C:/Program Files/Xinox Software/JCreatorV3LE/MyProjects/ThreeDRemake/Files/" + name + ".txt");
DataOutputStream fos = new DataOutputStream(xos);//ObjectOutputStream oos = new ObjectOutputStream(fos);
//oos.writeObject(myObject);
//for(int ob = 0; ob < ((ArrayList)myObject).size(); ob++)
ThreeDObject object = (ThreeDObject)(((ArrayList)myObject).get(0));
fos.writeChars("{");
for(int shape = 0; shape < object.getFaces().size(); shape++)
fos.writeChars("{");
ArrayList faces = object.getFaces();
for(int count = 0; count < ((Face)(faces.get(shape))).getPoints().size(); count++)
X = ((TDPoint)(((Face)(faces.get(shape))).getPoints().get(count))).getX();
Y = ((TDPoint)(((Face)(faces.get(shape))).getPoints().get(count))).getY();
Z = ((TDPoint)(((Face)(faces.get(shape))).getPoints().get(count))).getZ();
fos.writeChars("" + (int)X);
fos.writeChars(",");
fos.writeChars("" + (int)Y);
fos.writeChars(",");
fos.writeChars("" + (int)Z);
if(count != ((Face)(faces.get(shape))).getPoints().size()-1)
fos.writeChars(",");
if((count == ((Face)(faces.get(shape))).getPoints().size()-1) && (count < 5))
for(int lkj = count; lkj <5; lkj ++)
fos.writeChars(",");
fos.writeChars("" + (int)X);
fos.writeChars(",");
fos.writeChars("" + (int)Y);
fos.writeChars(",");
fos.writeChars("" + (int)Z);
fos.writeChars("}");
fos.writeChars("}");
fos.close();
xos.close();
} i happen to know for a fact that there are no faces with more than 6 points, so i used this line:if((count == ((Face)(faces.get(shape))).getPoints().size()-1) && (count < 5))and everything that follows to write ditto information(the last point) over and over again to fill up the array(i could even write a null value here if i wanted)
the problem im having is i seem to be missing two right brackets("}") and with all the information thats going through these loops its impossible to trace where and what is going wrong. can anyone point out any possible flaws to help me figure out what im doing wrong??
Message was edited by:
sosleepy
also, though its not important, when i do:fos.writeChars("...")//(i used writeChars(); to save myself the hassle of typeing writeChar((int)'char').)it writes a blankspace(spacebar) between each string i write, how can i prevent this from happening?
Message was edited by:
sosleepy
nvm i just realized what i was doing wrong... fixed the error, but a reply on the spaces between writes would be niceYou asked this same question a couple of months ago: http://forums.ni.com/t5/LabVIEW/Reading-Data-From-text-File/m-p/1756390#M612805
Well, you can use the Read Text file to read the file, and then just extract the lines... Ben64 showed you a method to use regular expressions. That's one way.
For Excel you can use the Report Generation Toolkit, or you can code it yourself using ActiveX. There's an example that ships with LabVIEW on writing a table to Excel.
For database operations you can use the Database Toolkit, or you can try to use LabSQL. -
How to load date and time from text file to oracle table through sqlloader
hi friends
i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
this is my data in this path (c:\external\my_data.txt)
7369,SMITH,17-NOV-81,09:14:04,CLERK,20
7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
7566,JONES,02-APR-81,09:24:10,MANAGER,20
7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
create table emp2 (empno number,
ename varchar2(20),
hiredate date,
etime date,
ejob varchar2(20),
deptno number);the control file code in this path (c:\external\ctrl.ctl)
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>any help i greatly appreciated
thanks
Edited by: user10947262 on May 31, 2010 9:47 AMload data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)Try
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>
That's not an error, you can see errors within log and bad files. -
I am batch processing in PS 2014 (watermark and saving as jpeg from ps file). I get the message for some but not all 'this file needs to be saved as a copy with this option'. And then I have to save it manually. Does anyone know why this happens? (It is just a plain photoshop file, a watermark is added, then save as jpeg - the jpeg is saved to a different folder than the original photoshop file.) It happens for about 10 of 30/40 files approximately . Thank you, Kathryn
I believe I have figured it out - I need to flatten the image, even though there are no layers except for layer 0, first.
-
Every time I open a New File from the File Menu and I open it all of my desktop items are in it. What's up with that?
This is configured in Finder preferences under the General icon. You can make some changes to that behavior.
-
How to read and write a data from extrenal file
Hi..
How to read and write a data from extrenal file using Pl/sql?
Is it possible from Dyanamic Sql or any other way?
Reagards
Rajuutl_file
Re: How to Create text(dat) file.
Message was edited by:
jeneesh -
Browsing and opening files from a file server
Hello!
I am interested if it is possible with AIR to browse files from a file server that is connected to a local network and open them. F.e. I want to create an application that opens template files with their native programs and save them on the file server under different name.
Thank you in advance
LyndaAIR 2 (now at labs.adobe.com) has features you are looking for. An AIR 2 application can open a file in the default system application registered for the file type. (The file server must be a mounted volume on the computer.)
An extended desktop application (an AIR 2 application that is installed with a native installer) can communicate with another application. So, if the AIR (extended desktop) application knows the path to the native application, it can open that application and communicate with it. If the native application has APIs for opening and saving files, the AIR application can communicate with it using those APIs. (So, this functionality depends on the capabilities of the native application.)
Maybe you are looking for
-
Help with changing a font color in a live font
I have motion 1 or studio 5 crossover. I added a live font to my canvas can can't get the color of the font to change. the font i am using is called "cool" and it is a default red. I have changed my color in the dashboard and even in the inspector, b
-
NetInstalls/Restores Failing - Constant Kernel Panics
Hello all - Before I begin, I admit to being a little over my skis and a bit of a rube when it comes to this stuff - I know just enough to royally screw stuff up. I've tried to do my due diligence in searching on the topic but haven't come up with a
-
Problems running Apple Hardware Test
I'm trying to run the Apple Hardware Test, but it never seems to start. I've tried holding down the C and option keys on restart, but all that happens is that the disk is ejected, and when I push it back in the computer restarts as normal. Is there a
-
COMPLTE CYCLE OF NRGP PROCESS WITH EXCISABLE PO
HI DEAR ALL Can anybody help me nrgp process My problem is basically excisable Po order against subcontract any process when to revere or clear excisable payment against subcontract process 1 .Create PO with item category as "L" . 2. Issue mater
-
Pressing enter key closes script
I am running director MX 2004 on a vista home premium machine (32 bit). Every time I press the enter key it closes the script and I can't figure out why this is happening. Has anyone else had this issue and if so how did you fix it. It is getting