How do I get the caption (Description) out of an image's metadata?

Taking a break from a monstrous project that has had me tied up for days, I have embarked upon what I thought would be a bit of light relief (hah!).
A colleague asked me for an easy way to get captions into InDesign. So I started scripting there, asking for the "description of the link xmp".
This was not forthcoming and a search of the InDesign scripting forum yielded the information that in order to get this information it was necessary to open the doc in Photoshop, save it and re-link. This indeed does work, but it is a waste of time in the file-saving stage and also degrades the image, as we have a jpg workflow.
So I thought that if I was going to have to got to Photoshop anyway, why not have the script go straight there, open the doc, ask for the description and close without saving?
Photoshop so far has jealously guarded its XMP information.
In Applescript I ask go "set theData to raw data of XMP metadata of document 1" and there it is in the event log, but in forbidding red type. I try adding "as string" and it appears twice, once in friendly black type, enclosed in quotes, and then the red stuff. However I find myself refused access to the information in the variable.
AS or JS solutions welcome...

tell application "Adobe InDesign CS2"
activate
tell active document
set This_Selection to get selection
try
if This_Selection ≠ {} then
if length of This_Selection ≠ 1 then
display dialog "You have more than 1 item seleted!!!" giving up after 2
else
if class of item 1 of This_Selection is image then
set This_Image to item 1 of This_Selection
end if
if class of item 1 of This_Selection is rectangle then
set This_Image to image 1 of item 1 of This_Selection
end if
set Image_Path to file path of item link of (item 1 of This_Image)
set MDLS_Result to my Get_XMP_Description(Image_Path)
set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " = "}
set Image_Desc to text item 2 of MDLS_Result
set AppleScript's text item delimiters to ASTID
display dialog Image_Desc giving up after 2
end if
else
display dialog "You have 0 items seleted!!!" giving up after 2
end if
on error
display dialog "This rectange contains NO image!!!" giving up after 2
end try
end tell
end tell
on Get_XMP_Description(File_Path)
try
do shell script "/usr/bin/mdls -name kMDItemDescription " & quoted form of POSIX path of File_Path
return the result
on error
return false
end try
end Get_XMP_Description

Similar Messages

  • I purchased an ablum thru itunes on my phone and it says i purchased the songs on itunes but when i go on my music it says i have to repurchase all the songs how can i get the songs with out havin to pay again

    I purchased an ablum thru itunes on my phone and it says i purchased the songs on itunes but when i go on my music it says i have to repurchase all the songs how can i get the songs with out havin to pay again

    Whether you can redownload music depends upon what country that you in. If you are using your computer's iTunes then does music show in the Purchased link under Quicklinks on the right-hand side of the iTunes store home page (on your phone you might be able to redownload media via the Purchased tab in the iTunes store app) ? If music shows there, but not that album, then check to see if it's hidden : http://support.apple.com/kb/HT4919
    If you aren't in a country when you can redownload music and it's still on your phone then you should be able to copy it over from the phone via File > Devices > Transfer Purchases.

  • How can I get the third battery out of the wireless keyboard to change it?

    I got a message to change the batteries in my keyboard, but only two batteries will come out.  Is there a way to get the third one out?

    turn your keyboard over-there should be a diagram telling you how many batteries
    it takes (2 or 3). If you do have a 3 battery keyboard, perhaps a little wiggling or tapping may help, or a little wd-40, maybe a chopstick?
    JB

  • How can I get the POST data out of a quiz?

    Trying to get data out of a quiz with PHP or ASP. How? Do I
    have to set up the Quiz Output to something in particular? I want
    to get the $_POST['correct'] information out --or
    Request.Form("correct"). How do I do it?

    This thread is cross posted. Please review the
    Posting
    Guidelines for more information on why this is a bad thing.
    Click
    here to view the original thread

  • How could i get the material description in cost esti itemization view?

    Hi Gurus,
    I have created the process order (T.Code COR1) and calculate the cost & get the material costing details.but i required to see the material description (Packaging material) rather than the material code (PK01-1204) in costing itemization view.
    E.g.
    SAP Material Code: PK01-1204 - Description - Packaging material.
    while checking the costing view  i had see the Material code PK01-1204 in itemization.but i required the material description (Packaging material) in itemization view.
    Please help me to overcome this issue......
    Regards,
    Dhananjay R.

    Dear Dhananjay,
    You can have Material description in Itemization by following way :
    Go to Itemization screen -
    > Change layout ( On top you will find icon for this , below Display Itemization text)
    In change layout you will see Filter icon ---> select Plant / Material Text by dropdown in it and save it so you will find material description in itemization.
    Try above which will resolve your issue.
    Revert in case any problem.
    HOpe this helps.
    Regards,
    Tejas

  • How can I get the DC component out of a signal in Labview

    I was trying to get the DC component of a signal using lowpass filters provided by Labview(professional version 8.2). I used the FIR windowed filter but I couldn't get what I expected. The sample rate is 20* the maxium signal frequency. I simulated a function like y= 10(volt)+Sin(2*pi*f*t+phase). If I set the low cutoff to be less than the frequency f, shouldn't I get 10 volt as the outputs?  See the attachment for vi. Thanks!
    Attachments:
    Simulation03062008.vi ‏53 KB

    Hi,
    You can use the filters located in Signal Processing -> Filters, then create a constant from the "filter type" input and select "Lowpass". There is also an AC & DC estimator vi, located in: Signal Processing -> Measurement.
    You may also use something like "running mean" filter. To do it you need to calculate the mean value in some range around every point. It will decrease the value of the noise and will give you the dc value (or slow changing part) of your signal. Finally you can use median filter.
    Benjamin R.
    R&D Software Development Manager
    http://www.fluigent.com/
    Attachments:
    meanrun.vi ‏21 KB

  • How do I get the best performance out of my graphics card under bootcamp?

    I have a 20" iMac, I think it was 2009 I got it, maybe 2010. It has an nVidia 9400 graphics card. I have installed windows XP under bootcamp with which to play games specicially Star Trek online and Star Wars The Old Republic (also online game). Now the minimum graphics spec for SWTOR is an nVidia 7800 yet with the 9400 I can only play if I run everything on the lowest possible settings. I'd assumed that the 9400 being several models higher than the 7800 I should be able to run a higher level of graphics and seem to be capable of running better quality when playing games under OS X.
    I may be wrong but it seems under bootcamp windows doesn't run my Mac at as high a level as it is capable. For one thing when I look under the specs it states I only have 2.7GB ram when the iMac actually has 4GB.
    Am I just over estimating the graphics potential of my iMac or am I right in thinking that Windows under bootcamp isn't utilising the iMac's full potential and how can I fix this?
    Any help will be appreciated.
    Thanks.

    you run into the limits of XP and built in graphics.
    I would hope that you found in all these years how to install and get new moddified gpu drivers.
    XP is limited and is 32-bit where each app gets 2GB address space also.
    Windows 7 64-bit (or 8 even free for now to test out) otherwise wait to buy a new Mac.

  • Hi everyone. How do you get the 'var' folder out of your trashcan? HELPPPPP

    my friend jess put her var folder in the trashcan so she could make room on her laptop but her apps started to stop working and then her computer turned to the screen with the wheel on it and now shes freaking out help!
    (also she wants to know if all her tv shows are going to be deleted)
    PLEASE HELP

    How well do you know your way around Mac OS?
    you are going to need to boot into Recovery and reinstall the system.
    they should already be using TimeMachine at a minimum for backups
    If you need to erase the system drive AND don't have backups, then yes you could lose files.
    Also might want to shop for some drives to help with this /
    Install OS X to another external drive rather than on the laptop's so you can boot and work at backups and reinstall and repairs.
    Install or Reinstall Mavericks or Mountain Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because
    the following procedure will remove everything from the hard drive.
    OS X Mavericks- Erase and reinstall OS X
    OS X Mountain Lion- Erase and reinstall OS X
    OS X Lion- Erase and reinstall Mac OS X
    About TimeMachine backups and Recovery Mode
    http://support.apple.com/kb/HT1427
    http://www.apple.com/osx/recovery/
    OS X Lion and later let you:
    Start from OS X Recovery using your Time Machine backup disk. With OS X v10.7.3 and later, Time Machine backs up the Recovery System on your Mac to your backup drive as well. This lets you use your Time Machine drive to start up your Mac if needed.     OS X Recovery:
    http://support.apple.com/kb/ht4718
    OS X Internet Recovery
    Mac models introduced after public availability of OS X Lion include the ability to start up directly from an Internet-based version of the OS X Recovery system. OS X automatically uses this feature when the Recovery System on the hard disk isn't available (such as when your hard disk encounters an issue, or when your hard disk has been replaced or erased). OS X Internet Recovery lets you start your Mac directly from Apple's servers. Starting up from this system performs a quick test of your memory and hard drive to check for hardware issues.
    OS X Internet Recovery presents a limited interface at first, with only the ability to select your preferred Wi-Fi network and, if needed, entering a passphrase. Next, OS X Internet Recovery downloads and starts from a Recovery System image. From there, you are offered the same utilities and options as a local Recovery System.
    Requirements for reinstalling OS X using Recovery
    Reinstalling OS X using OS X Recovery requires broadband access to the Internet via Wi-Fi or an Ethernet connection. OS X is downloaded over the Internet from Apple when OS X Recovery is used for reinstallation
    If you use Internet Recovery to reinstall OS X, it installs the version of OS X that originally came with your computer. After installation is finished, use the Mac App Store to install related updates or later versions of OS X that you have previously purchased.
    What to do if the installer warns that no Recovery System can be created
    Some disk partition configurations may result in the OS X installer reporting that it could not create a Recovery System. In these situations, even if you are permitted to continue the install, you may want to quit the installation and create an external, bootable OS X hard drive with a Recovery System, first. You can continue your OS X upgrade on your computer's startup drive after creating an external Recovery System.
    Your storage device must have at least 13 GB available (after formatting) to install OS X Lion or later and a Recovery partition.
    These steps erase and reformat the storage device. This article instructs you on setting up a storage device to use the GUID partition scheme and the Mac OS Extended (Journaled) format, which are required to install OS X and a Recovery partition on your external storage device. You should back up any important files that are on the device to a different drive.
    This procedure installs a version of OS X that is compatible with the Mac it was created with. Using this OS X system with a different Mac model may produce unpredictable results.
    Your computer's serial number is sent to Apple as part of this process to help authenticate your request to download and install OS X Lion.
    http://support.apple.com/kb/ht4718
    Installing OS X on an external volume - such as your USB flash drive
    http://support.apple.com/kb/HT5911
    Mac OS X Help
    http://www.apple.com/support/macbasics/
    Isolating Issues in Mac OS
    http://support.apple.com/kb/TS1388
    https://www.apple.com/support/osx/
    https://www.apple.com/support/quickassist/
    http://www.apple.com/support/mac101/help/
    http://www.apple.com/support/mac101/tour/
    Get Help with your Product
    http://docs.info.apple.com/article.html?artnum=304725
    Apple Mac App Store
    https://discussions.apple.com/community/mac_app_store/using_mac_apple_store
    How to Buy Mac OS X Mountain Lion/Lion
    http://www.apple.com/osx/how-to-upgrade/
    TimeMachine 101
    https://support.apple.com/kb/HT1427
    http://www.apple.com/support/timemachine
    Mac OS X Community
    https://discussions.apple.com/community/mac_os
    Recovery Mode
    http://support.apple.com/kb/HT4718
    ExpressLane
    https://expresslane.apple.com/
    Startup Manager: How to select a startup volume
    http://support.apple.com/kb/HT131
    How to install OS X on a new or faulty HD without Internet recovery
    Corrupt and new disks might not have a working Recovery partition, but there are still ways to access one and reinstall OS X, if needed.
    http://reviews.cnet.com/8301-13727_7-57594422-263/how-to-install-os-x-on-a-new-o r-faulty-hd-without-internet-recovery/
    Direct you to the proper forum for MacBook :
    MacBook Series Forums
    https://discussions.apple.com/community/notebooks?view=discussions
    http://www.apple.com/support/macbookpro
    Mac OS X Forum
    https://discussions.apple.com/community/mac_os?view=discussions

  • How do you get the iTunes visualizer OUT of fullscreen mode?

    I'm using WhiteCap as a Plugin visualizer.
    I pressed CTRL+F once upon a time to put the visualizer full screen, now I'm finding it impossible to put it back.
    Whilst in the visualizer if I right click or press CTRL+F again, it closes the visualizer, and when reopened it's still full screen.
    I need it not-fullscreen to change the settings in WhiteCap.
    So how do I fix this?
    I don't want to Re-Install iTunes because I spend ALOT of time sorting my iTunes library.

    Im sorry but I figured it out now. I hate when you figure something out right after you do something extreme like signup for a profile here and post a question. Well to those who want the answer all in one shot there are 2 solutions for me.
    1. Make sure Safari is updated completely. You can check by clicking SAFARI> ABOUT SAFARI
    Safari 5.0.5 gave me this problem but the new update is 5.1.2
    2.Glims - Free ad on for Safari which enables you to view you window in COMPLETE full screen at all times, as well as maximise your window to fill all empty space (makes so you dont have to worry about accidentally clicking on your desktop which I do all the time lol). You can use this option once Glims is installed simply by clicking on
    SAFARI> Full Screen
    or
    SAFARI> Maximise Window Size
    By doing Full Screen mode you can then click on the full screen capability on the website you are on

  • How do I get the coffee stain out of my MacBook Pro screen? Spilled coffee on it e

    I spilled coffee on my MacBook Pro this morning .... used the cool setting on my blow dryer for 20 mintues to dry out the keypad .... 
    Switched it back on in 4 hours .... everything works , except I now have a coffee stain behind my screen .... is there a way to absorb that out
    or do I have to buy a new lid for my computer ?

    You might have to have a new screen installed.  It's not too expensive ($160) and it's DIY, if you have the right tools and skills.
    http://www.powerbookmedic.com/15-Inch-MacBook-Unibody-Display-LCD-Screen-NEW-p-1 7295.html

  • How do you get the Menu Bar out of Fullscreen mode with Safari?

    When I click on Full Screen mode to watch video the Menu Bar remains at the top of the screen. This just recently happened and its only with Safari because Firefox's Full Screen mode works as it should. I have read many forums with questions similar to mine but none have helped. Please keep in mind when you answer this question that it is NOT JUST WITH YOUTUBE. This is happening with every website that I use to watch videos. I suspect that the update had something to do with this because if memory serves right it happened the last time I updated.

    Im sorry but I figured it out now. I hate when you figure something out right after you do something extreme like signup for a profile here and post a question. Well to those who want the answer all in one shot there are 2 solutions for me.
    1. Make sure Safari is updated completely. You can check by clicking SAFARI> ABOUT SAFARI
    Safari 5.0.5 gave me this problem but the new update is 5.1.2
    2.Glims - Free ad on for Safari which enables you to view you window in COMPLETE full screen at all times, as well as maximise your window to fill all empty space (makes so you dont have to worry about accidentally clicking on your desktop which I do all the time lol). You can use this option once Glims is installed simply by clicking on
    SAFARI> Full Screen
    or
    SAFARI> Maximise Window Size
    By doing Full Screen mode you can then click on the full screen capability on the website you are on

  • On my iphone 5 how do i get the sim card out?

    I have the tool you use to open the tray but how do i do it? everytime i try i feel like im ruining it.

    Push the SIM ejection tool into the slot on the side of the device.
    The SIM tray will eject.

  • HT1725 I bought an album and some of the songs didnt download all the way and then said i need to repurchase it how do i get the songs with out repurchasing it??

    I bought an album and some songs didnt download and there wanting me to re but then help me?

    Downloading past purchases from the App Store ... - Support - Apple

  • How do I get the default zooming to not include images or how can I resize everything but actual images?

    I have a problem with the default zooming in firefox Using default layout.css.devPixelsPerPx=-1 or layout.css.devPixelsPerPx=1.5 makes all UI and webpage text look nice and readable, spacing is fine and everything. The only problem is that images are ALSO zoomed which is ridiculous. I guess I would like a way to scale everything BUT images. I have a hi-resolution monitor and think it's silly to have to zoom out every image on a web page just because I wanted text and the UI enlarged. I tried NoSquint using 65% for pages and 150% for text only, but that had the issue of making ONLY text scaled up and not spacing and other stuff (google searches looked even more silly using only 6 cm to the left, rows too close overwrote themselves etc.)

    That is not possible.
    The layout.css.devPixelsPerPx pref affects everything in Firefox, both the user interface and the browsing area.
    'Full page zoom' affects all elements on web pages including images and 'zoom text only' affects the text and can cause issues with text overlapping or disappearing similar to setting a minimum font size because the containing element keeps the same dimensions.
    You can't just exclude the images from zoom and have the containers expand automatically.

  • HT4053 I inserted the SIM and it says SIM failure. How do I get the SIM out. I got the phone from someone who took out the SIM so I can insert mine.

    I am new to the smart phone. I got a used one abut the person took out their SIM card. I put in my SIM card and it shows SIM failure. How do I get the SIM card out?

    Look at the SIM card tray.
    You will see a small hole.
    Poke a SIM card removal tool or small paper clip into the hole until the tray pops out.
    Remove the tray.

Maybe you are looking for

  • CX_SY_FILE_OPEN_MODE - short dump on production but not in Dev and Test

    Hello, I'm getting the follwoing short dump in production when I run the program which writes the data to application server. I have open data set and close data set. Same program when I in development and test I do not get any short dump. Can any kn

  • Cannot  set display resolution after upgrading to Mavericks

    I have early Mac Mini  connected to KVM stitch.  Over the weekend I upgraded to Mavericks and it "dowgraded" display resolution from 1920x1200 to 1600x1200 and everythign looks streached.  1920x1200  no longer shows on the list in display properties

  • Problem with createTempFile

    I am following code in Joseph Weber's Using Java2 Special Edition. I am getting an error when compiling the following code (taken from the cd accompanying the book): File tempFile = File.createTempFile("temp#que"); The following error ensues: cannot

  • HT3529 iPod touch does not have Message Icon.. Why?

    I recently reset my ipod and now the message icon is gone. How do I get it back?

  • VAT Number link to Customer tax clasification

    Dear All, Give your some inputs on VAT number and Customer tax classifications for MWST determination in sales order, Please check sales orders in scenrio's 1. VAT number not given in customer master  in general data - Sold to party. SON - 1 where MW