Terminal command equivalent to Automator's 'set metadata pdf'

Hi,
When I make pdf docs I sometimes want to erase my name from the Author metadata, and put something into Title and so on.
I know that Automator has an action called set pdf metadata, which I have successfully used.  But I would like a Terminal command that I could use instead.
Googling this question returns suggestions of downloading pdf-manipulation libraries which are too elaborate for me to use.  I'm hoping that Automator is simply utilising a terminal command already built-in.
Is there such a command?
Diddles

A bit of experimenting.
Given a file temp.pdf in the current working directory . . .
xattr -w "com.apple.metadata:kMDItemAuthors" "diddles1234" temp.pdf
writes the string "diddles1234" to the Authors metadata field of temp.pdf.
xattr -w "com.apple.metadata:kMDItemTitle" "newmetatitle" temp.pdf
writes the string "newmetatitle" to Title metadata field of temp.pdf.
However, if you try to put spaces into the string like this:
xattr -w "com.apple.metadata:kMDItemTitle" "new meta title" temp.pdf
the title field will not be changed to "new meta title". In fact, if you start with "original title" as the value of kMDItemTitle, successfully change it to "newmetatitle", and then later try to change it again to "new meta title", the value of kMDItemTitle reverts to "original title". The OS appears to "forget" the intermediate change to "newmetatitle".
As best I can figure, in the event of a failed xattr write command, the original kMDItemTitle is rebuilt from semi-redundant data within the PDF--but more experimentation would be required to prove it. (The same is true of kMDItemAuthors, by the way.) Quick take away: The first two commands above will work if you don't use spaces in the strings to be inserted into the metadata fields. Someone more proficient in UNIX may have a better solution or explanation.

Similar Messages

  • Terminal command for switching a printer setting?

    Creating a packagemaker package to install a printer. I create a duplex custom preset in /Library/Preferences/ and it shows up in the list of settings. However, I don't know how to make it the default for the printer I install. Any easy way to do this?
    Thanks.

    AppleScript may be able to do this, if that's possible in your setup.

  • Terminal Command, how to set defaults write, make application(s) use directory path where file last saved?

    Does anyone know whether there's a terminal command to make all applications remember/use the last directory/path where I last saved a file?
    For example, let's say there are (10) ten PDF's on a website, and I want to use Preview.app to open and save each file to the same directory.
    Problem is, after each time I save a file, Preview.app doesn't automatically remember/use the last directory where I saved my file(s).
    Forcing me to navigate back to the same directory after each time I save a file; super-annoying.
    But, for some reason, when saving images from the web, Firefox remembers the last directory where I saved the file (jpeg).
    So I'm hoping there's some way, possibly a terminal command to set/force all applications (including Preview.app) to remember/use the directory/path where file(s) were last-saved.
    Anyone?

    Get the third-party utility Default Folder X 4.4.9.

  • Need terminal command for setting display colors ASAP!!!!!

    Hello everyone,
    I was being dumb and figured, oh what will this do?
    I know, I know one of those button pushers...anyway I set the Display colors to 256 on my Xserve, which has no video card in it, and now all I see in Chicken of the VNC is a black screen. Im sure there is a terminal command out there where
    I can ssh into the Xserve, and change the colors back, but I can't find it...could someone post it up here or point me in the right direction please?
    Thanx in advance!!!!!!!

    didn't even think of that...seems to be the most obvious things, seem to be the first to be overlooked.
    Will let you know.

  • Terminal command for setting software update to defaults

    terminal command for setting software update to defaults?

    didn't even think of that...seems to be the most obvious things, seem to be the first to be overlooked.
    Will let you know.

  • Terminal command which set background a picture

    hello
    i am search 2 days now to find a terminal command which set a picture as wallpaper but i didnt find anything.
    System/Library/Frameworks/ScreenSaver.framework/Resources/
    ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
    I found that this set as background the screen saver. I tried use the path of wallpaper and then -bakcground but i got the message "permission denied".

    the easiest way to do that is using apple script as follows:
    tell application "System Events"
    -- SET DESKTOP TO SPECIFIC PICTURE
    tell current desktop
    set picture rotation to 0 -- (0=off, 1=interval, 2=login, 3=sleep)
    set picture to file "Mac OS X:Library:Desktop Pictures:Plants:Agave.jpg"
    end tell
    end tell
    you can call an apple script from a shell script using osascript command. You can also directly embed it into a shell script using osascript with -e switch.

  • Terminal commands with automator and Safari

    Hey guys, I'm trying to create an automator that will open safari, enable private browsing, go to my site, and log myself in. The problem is I need a terminal command line that will ensure private browsing is enabled. Any tips / help is appreciated. Thanks

    Terminal and Unix queries are best posted to the Unix forum under OS X Technologies.

  • Passing files in automator to a terminal command?

    I would like to know if something is possible: I've used automator to sort through a large number of files for specific traits using the 'Filter Finder Items' action. Can I then pass these files, one by one, into a terminal command?
    Specifically, I have a bunch of markdown files that I want to run through the markdown command in the terminal.
    Thanks for any help,

    automator has "run shell script" action. just add that action to the end of your wrokflow with the option to pass input as arguments.

  • How to save terminal command and output history to pdf on exit?

    When I exit a terminal session (terminal.app), I would like to automatically save the commands and output from the session to a PDF (or text file) as a reference. 
    I can do this manually in Terminal by selecting Shell --> Print... --> PDF --> Save as PDF...
    Unfortunately, I'm too forgetful to remember to do this each time before I exit. 
    Is there an alias I could set or some other method to automatically save the contents of my session to a PDF when I exit?
    Thank you in advance,
    jjw

    Frank,
    Your response was helpful, but I realized after looking at my .bash_history file that only the commands entered are listed, not the output.  I would like my commands to be printed out, but also the result from the commands (in this simple example, the directory listing):
    myuserid[~/galaxy-dist/tools]$ cd ncbi_blast_plus
    -------------------------------------------------------------------------------- ----------------------------------------------------- 09:48:37
    myuserid[~/galaxy-dist/tools/ncbi_blast_plus]$ ls
    blastxml_to_tabular.py   hide_stderr.py           ncbi_blastp_wrapper.xml  ncbi_tblastn_wrapper.xml
    blastxml_to_tabular.xml  ncbi_blastn_wrapper.xml  ncbi_blastx_wrapper.xml  ncbi_tblastx_wrapper.xml
    -------------------------------------------------------------------------------- ----------------------------------------------------- 09:48:38
    myuserid[~/galaxy-dist/tools/ncbi_blast_plus]$
    I'm thinking that there is an automator script or an alias that I could use so that when I type, "exit", the commands and output for the session would be sent to a PDF and then the session would close.
    I know it seems like an odd thing to want, but sometimes I'll forget the sequence of commands that gave me the correct output (plus, my command prompt has a timestamp on it, too).
    Thanks, though, for the .bash_history information.
    jjw

  • Fcsvr_client | xml export of all assets | set metadata field of specific asset

    Hey folks,
    we are switching to another mam but we still need fcsvr for some time.
    So do you guys know if there is a terminal command for the following requirements!?
    (1)
    export an xml file for every asset with every mdValue fieldname like
    location, file name, creation date, our custom fields aso. (this will be imported to the new mam)
    (2)
    setting a metadata field of an specific asset in fcsvr
    for example:
    set
    <mdValue fieldname="Checked" dataType="string">not checked</mdValue>
    to
    <mdValue fieldname="Checked" dataType="string">is okay</mdValue>
    or
    <mdValue fieldname="Checked" dataType="string">edit needed</mdValue>
    I need to do this with an terminal command, not by subscription oder schedule.
    Do you have any ideas?
    Kindly regards

    Looks like your xml is missing an open and a close. Try this:
    <?xml version="1.0"?>
    <session>
    <values>
    <value id="CRIT_TYPE">
    <int>3</int>
    </value>
    <value id="CRIT_INTERSECT">
    <valuesList>
    <values>
    <value id="CRITCMPVALUE">
    <value id="ASSET_NUMBER">
    <bigint>5000</bigint>
    </value>
    </value>
    <value id="CRITCMPOP">
    <atom>gt</atom>
    </value>
    <value id="CRIT_TYPE">
    <int>1</int>
    </value>
    </values>
    </valuesList>
    </value>
    </values>
    </session>
    Worked great for me!

  • How can I change the "Ask to join new networks" option using a terminal command?

    We are currently switching to a new wireless network throughout our school district and I have pushed commands to connect to the new and remove the old. However, any Macs that have "Ask to join new networks" enabled are jumping over to our unsecure guest network, even if that network has been removed from the list of Preferred Networks. So far the fix has been to remove the guest network from the list of Preferred Networks and then disable Ask to join. The only issue I'm running into now is I have been unable to find a terminal command to change this setting. Once I have the command I can write a script and send that out to all of the Macs.
    So is there a way to disable "Ask to join new networks" using command line?

    sed -i "" 's/Prompt/DoNothing/' /Library/Preferences/SystemConfiguration/preferences.plist

  • How to reset the network IP address from terminal/command line in Mac OSX?

    Do anyone knows how to set the network IP address from terminal/command line in Mac OS X?

    how about a GUI, ever heard of a GUI? it's this really neat thing, where you don't have to worry about remembering long strings of text to do something. Mac OS X actually has a rather decent one (that was sarcasm by the way, Mac is the best) you could have it done in like 30 sec, if you use the network pane of system preferences.

  • Terminal Commands for Internet Connect VPN?

    I could maybe do this as an applescript but I'm hoping there are terminal commands which I can incorporate into an rsync script...
    I need to open a PPTP VPN connection on a computer (Internet Connect VPN client, 10.4.8) , to connect to VPN services on OS X Server (10.4.8). The configuration works fine but really needs manual intervention at times. I would like to just script the equivalent of hitting the 'connect' button, so this can be run by cron.
    Any ideas or links?
    Ta.
    -david

    I did repair permissions with disk Utility and I used Onyx to delete the various caches, but that didn't work.
    Everything is functioning. The problem isn't on the VPN server side, because I can log into the VPN on my Powerbook and the status shows correctly. There's definitely something going on with my G5.
    This isn't a really huge deal, but it would be nice if the status indicated that I'm connected when I'm connected.

  • What Is The Terminal Command For PRAM & SMC Reset?

    Hi Folks - Cant get my Macbook Pro to shut down (instead it does a re-start) thus the key combination for these re-sets doesnt seem to function (no chimes). I saw in another thread a terminal command entry "sudo nvram boot-args=”-p -r” but I also saw it mentioned that entering that casued the following to pop-up "Note that resetting the PRAM will wipe out the contents of the boot-args environment variable, which means the command would need to be reissued each startup." Whats with "reissued each startup"? Also would like a an SMC re-set command. THANKS in advance!

    I dont know of a terminal command but here is how to reset the SMC:
    Resetting the System Management Controller (SMC)
    Resetting the SMC on Mac portables with a battery you can remove
    Shut down the computer.
    Disconnect the MagSafe power adapter from the computer, if it's connected.
    Remove the battery (to remove the battery - click here: MacBook or MacBook Pro).
    Press and hold the power button for 5 seconds.
    Release the power button.
    Reconnect the battery and MagSafe power adapter.
    Press the power button to turn on the computer.
    Resetting the SMC on portables with a battery you should not remove on your own
    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer.

  • Is there a Terminal command that will pick up DNS numbers?

    Hello all,
    Is there a Terminal command that will pick up the DNS numbers utilized by a router?
    The router options don't show any, though the router is set to use PPPoA to pick them up.
    I kindly TIA,
    Eme '~[ )♥♪

    Hi, Thanks for the reply, I appreciate it.
    What do you mean by "pick up"?
    I mean to show what the DNS numbers are that the router is using.
    They are not entered in the DNS server field in Networks, TCP/IP tab.
    If you mean refresh the client settings, the DNS settings are obtained as part of the DHCP lease (or PPP connection in the case of PPP).
    The user/ OP is actually using PPPoA, when i googled PPPoA.. seems he is using Cisco perhaps.
    http://en.wikipedia.org/wiki/Point-to-PointProtocol_overATM (Asynchronous Transfer Mode)
    "PPPOA or PPPoA, Point-to-Point Protocol (PPP) over ATM, is a network protocol for encapsulating PPP frames in ATM AAL5. It is used mainly with cable modem, DSL and ADSL services.
    It offers standard PPP features such as authentication, encryption, and compression. If it is used as the connection encapsulation method on an ATM based network it can reduce overhead slightly (around 0.58%) in comparison to PPPoE".
    Essentially the original poster removed the OpenDNS #s from his DNS server field in the TCP/IP tab (b/c they seem to make Adobe.com inaccessible to him)
    removing them & allowing his router to "pick them up from the ISP" seems to solved his problem.
    However he can not, find what the numbers are that are being utilized,
    b/c they are not entered as usual in the Network, & part of the DHCP lease,
    or in Airport admin Utility.
    I/ we wondered, if there was a Terminal command that will show what the
    numbers are that are being used .
    Does that help clarify what I mean? Sorry to be so long winded.
    Eme '~[ )♥♪

Maybe you are looking for

  • Java application to connect to AP 7.00 (IPC)

    Hi, I have to develop standalone java application that connects to IPC and does configurations via the IPC Server (via the RFCs the IPC Server exports). I have JCo connection to the SAP ECC system (only one server. I assume the IPC server is running

  • Kernel Panic on Macbook Air

    Dear All, I purchased my Macbook Air in the US in August 2011. Now it is  only less than two years. Starting from two weeks ago, my Mac air starts to have the four language restart box very often. I took it to the Apple Genuis Bar and got my whole sy

  • What is the Tcode for Zform

    what is the Tcode for Zform

  • Problem with loading some forum sites

    I am unable to load some forum websites such as macrumors, droidfourms, and androidforums. Sometimes it works, but only for about a minute or two, then proceeds to go back to being unable to load it. The problem is that it loads just the top of the w

  • Cannot get updates for books in iBooks

    On my iPad mini I open the iBooks app (4.2) and there's a red number at the bottom in the Puchased section.  I think this means there are updates to some of the books.  I click on the number, get a blank screen that at first says loading then nothing