How to change "open with" defaults via command line?!?

folks,
i know that if i get info on a file -- in this case, a filemaker 5.5 file -- i can choose the default "open with" settings and apply those settings to all files of that kind. see the attached image for what i mean.
but how do i do that via the command line?
thus far, here's what i've got: i know that i can open a document called "scrubbing shell.sh" on my desktop WITH either MS Word of TextEdit by calling:
open -a textedit /Users/david/Desktop/scrubbing-shell.sh
or
open -a Microsoft\ Word /Users/david/Desktop/scrubbing-shell.sh
no sweat. BUT....how do i set the defaults so that it ALWAYS opens with that app in the future when double-clicking via the GUI?
many thanks, ya'll!
david koff
associate systems admin
the j. paul getty trust
dkoff AT getty DOT edu

Hi David,
   OK, I investigated the new format and treatment. It appears that the first entry in the property list file that matches the file being opened wins. The Finder may still honor the new format; when I moved my old Panther file into Tiger it seemed to work. However, in other ways, the Finder doesn't recognize the old format, which is the format of the FileMaker entries you posted.
   The Finder puts all of the new format entries at the beginning of the property list file. If you change a preference that was controlled by an old format entry, the Finder won't edit that entry. What it will do is to create a new entry in the new format closer to the beginning of the file than any of the old-format entries. SInce the new entry comes first, the old one doesn't apply. If you then edit the preference and change it back to what it was before, the Finder will edit the new entry. Consider the following sequence of events and commands:
% cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
I change all GIF files to be opened by GraphicConverter instead of Preview, which is an old setting in the old format.
% plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
% diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
404,409d403
<      <dict>
<         <key>LSHandlerContentType</key>
<         <string>com.compuserve.gif</string>
<         <key>LSHandlerRoleAll</key>
<         <string>com.lemkesoft.graphicconverter</string>
<      </dict>
Then I change all the GIF files to be opened by Preview again.
% plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
% cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
% diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
404,409d403
<       <dict>
<          <key>LSHandlerContentType</key>
<          <string>com.compuserve.gif</string>
<          <key>LSHandlerRoleAll</key>
<          <string>com.apple.preview</string>
<       </dict>
% diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
408c408
<          <string>com.apple.preview</string>
          <string>com.lemkesoft.graphicconverter</string>
   Note that I had to change the file to text after every change because the Finder converted the file to binary format every time it edited it. I didn't have to logout or reboot; the property list file change less than a second after the preference was set. I'm guessing that because you were just looking at the old-format entry, you missed the real changes to your property list file. Did it change from text to binary format? Try the command line tools that I used above.
   Note that this means that it matters where you put your entries in the property list file if you edit it.
Gary
~~~~
   There are only 10 kinds of people in the world. Those
   who understand binary numbers and those who don't.

Similar Messages

  • How to change "Open With" default

    When one has, say, a .tiff image stored in the Documents folder how does one change the "open with" default? For instance, if Photoshop is given as the default, how does one change this to Preview?

    HI,
    Right or control click the file, then click Get Info. Click the Open With discovery triangle and select the application you want to open that file with. You may have to click Other and navigate to the Applications folder to select the app, ie., Preview.
    http://www.ehow.com/how4548206quick-change-files-default-application.html
    Carolyn
    Message was edited by: Carolyn Samit

  • Simple Question-How to change open with default

    This should be a simple thing to do but the system preferences don't allow me to change it. I want to open jpegs with Preview and Photoshop is the default.
    Besides,the system preferences is pretty lame to me. Very basic stuff. Can anyone help me with this?
    Can I be notified by email? [email protected] Thanks!
    Mike

    Click once on a jpeg. Do a Get-Info, (command-I). In the drop down window Open with: select Preview. then select Change all.

  • How to turn off Bluetooth adapter via command line or script?

    I'm trying to write a batch script that will be able to turn on/off any connected Bluetooth adapters.
    In the "Bluetooth Settings" window, how can I change the "Turn off Bluetooth adapter" setting via command line or script?
    Due to my account not being verified yet, I cannot post a screenshot.  I will update this thread as soon as my account is verified.

    get-service -DisplayName 'Bluetooth Support Service' | Stop-Service
    ¯\_(ツ)_/¯

  • Add protocol args with quotes via command-line

    I am creating a small script to insert objects into the SGD databases (ENS) via command-line and perl. I have some difficulties with protocol-arguments which require quotes (").
    For example:
    /opt/tarantella/bin/tarantella object new_windowsapp --name "o=applications/cn=new_winapp" --width 600 --height 800 --protoargs "<protocol-arguments>"
    The problem comes when I need to add multiple protocol-arguments with quotes like: -dir "c:\Program Files\Application Directory"
    Can someone tell me how to add those arguments including the quotes?
    Thanks,
    Remold Krol | Everett

    Try to use the single quote ( ' )
    say, for instance
    protoargs 'dir "c:\Program Files\Application Directory" '
    That works for me.
    Regards.

  • [SOLVED] How to Crop an MP4 Video via Command-line?

    I have ffmpeg, mpg123, and mencoder. Does anyone know of a way I could use any of those to crop an mp4 video via command-line? I am trying to take off the black space above and below a video. Thanks in advance!
    Last edited by tony5429 (2009-04-12 00:12:57)

    I don't think it's possible to crop without re-encoding, but you can crop from the command line with ffmpeg and mencoder. Not sure about mpg123 - I think that's for playing audio but I could be wrong there.
    Anyway, with ffmpeg you can do cropping by using -croptop, -cropbottom, -cropleft, and -cropright. So if you wanted to crop 16 pixels off of the top and the bottom, your command line would look something like this:
    ffmpeg -i <input file> -croptop 16 -cropbottom 16 <video encoding options> <audio encoding options> <output file>
    With mencoder you use the "crop" video filter, like this:
    mencoder <input file> -o <output file> -vf crop=320:208:0:16 <other options>
    where the "320:208:0:16" means that the resulting picture is 320 pixels wide, 208 pixels high, and the 0:16 is the x,y position of the cropped area.
    These command lines are just really very basic examples - ffmpeg and mencoder have a LOT of options. Way too many to explain here. If you don't believe me, just try reading through the mencoder man page sometime. (There's an online version of it at: http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html)
    Hope this helps!!

  • How to open an url via command line?

    Hi all,
    I want to open a pdf file via a command from a web location. I try this: "AcroRd32.exe http://server/path/file.pdf" to do so, but this way results in an error message about bad filename.
    Is it possible to open a pdf in such a matter?
    Background:
    We use a CRM, the CRM use of webdav to allow content changes. The CRM is written in JSP and use a java applet to start the appropriated application for changing the content of a document. This works fine for all sorts of apps (winword, texteditors), only acrobat has problems with approach.
    Thanks for your support
    Lars

    Hi,
    I also need to know if it's possible to open a document on the web from the command line.
    It is possible to specify the URL in the Open dialog of the client, why not from the command line?
    No answer has been received for this question during the last few years!
    Doesn't anybody know the answer to this?
    Maybe the answer is "No, it can't be done"?
    Mvh/Tommy

  • How to change "Open With" list?

    Hi,
    I have a file extension for my source files which is PRG. So I have main.prg, test.prg, etc..
    Now, how can I change the default application that opens all files with that extension? I already tried "Open With" -> "Other.." -> Selct a application, click the "Always open with" checkbox, but finder still keeps opening my PRG files with the standard application..
    Is there any other way to do it?
    Tx!
    Sincerely,
    Patrick Mast,
    xHarbour.com Inc.
    http://www.xHarbour.com
    http://www.WinFakt.be

    Thank you all. I got it working now.
    Tx!
    Sincerely,
    Patrick Mast,
    xHarbour.com Inc.
    http://www.xHarbour.com
    http://www.WinFakt.be

  • How to change "Open With" Settings

    At work I use a PowerMac to do artwork and such, but I haven't had it long. Before then I had a crappy PC (that thankfully died, so I could convince my boss to get me a PowerMac XD). The boss for a while used CorelDRAW, and a lot of old files are in this format on an external hard drive. Unfortunately for Mac users the file extension is .cdr which is also a disc image format. I want to change the "Open With" settings on all of these files, but I want to be able to double-click on cdr disc images and mount them. Is there some way to do this, someway to get OS X to know that those files aren't disc images but CorelDRAW documents? If it makes it any easier (dunno if it would matter) all of the CorelDRAW documents will always be stored on the external hard drive.

    I have about 4 or 5 of them on my desktop right now. OS X by default can mount them, and by default has the cdr extension labeled as a disc image. They're typically used by Toast to clone CDs directly without changing their file structure in any way, especially useful for bootable discs. There's some Windows and UNIX programs that can use them as well.
    I've already made the CorelDRAW files easily searchable through Spotlight by inserting metadata, but I was just wondering if there was a way to tell OS X that these aren't disc images, but CorelDRAW files and have them open in Illustrator by default. If there isn't oh well.

  • Changing Open With Default App Won't Stick...

    I have a couple of versions of the same app installed and I need the older version of the app to be the default app that globally opens whenever I double-click one of its files.
    I've tried the Get Info -> Open With -> Select App ->Change All procedure but after clicking the Change All button, it immediately reverts back to the newer version of the application.
    I need to be able to support both versions of the app. I've tried downloading RCDefaultApp but that didn't help. Moving the newer version app to another partition is not option. Re-installing the newer version of the app onto another partition is not an option either.
    I would be grateful for any suggestions
    Thanks,
    Jon
    Message was edited by: Jon Morgan1

    The two Get Info options seem to use different methods to select the application. The 'Open with:' changes the Finder's default application property, but it looks like the 'Change All…' button uses the file type identifier to find the default application. Since the file type identifier is usually the same for all versions, the latest version is apparently the one that gets used. You should be able to select the older version on a file-by-file basis, or use the file inspector to change multiple documents. An AppleScript could also be used, perhaps a folder action to change the default application for files dropped into a folder.

  • Changing the override file via command line arguments

    Is there a way to change name of the file Coherence uses to override coherence-config.xml via a command line argument? I'd like to specify different override filenames in different environments.

    I get the message that:
    2006-02-13 16:53:27.699 Tangosol Coherence 3.0.1/317 <D5> (thread=main, member=n/a): Optional configuration file "/home/noah/tools/tangosol-config/tangosol-coherence-override-dev.xml" is not specified
    I specified the following as the startup:
    java -Dtangosol.coherence.override=/home/noah/tools/tangosol-config/tangosol-coherence-override-dev.xml -Dtangosol.coherence.log.level=5 -classpath /home/ncohen/tools/tangosol-config:/home/noah/tools/tangosol/lib/coherence.jar com.tangosol.net.CacheFactory
    Where the tangosol-config directory contains my override file tangosol-coherence-override-dev.xml
    If I change the name of the override file solely in the cmd prompt, it doesn't find any of them. It just gives me the optional configuration file ..... is not specified. How does one go about fixing this? Thx.
    Message was edited by:
    noah

  • Change Application-Based firewall via command line

    I'm looking for the command line method of changing the application-based firewall. I am not referring to ipfw, which I already have configured. Basically, all I want to do is change "Set access for specific services and applications" to "Allow all incoming connections" under Security > Firewall. However, I need to do this via ssh, so I need the command line method.

    sysadmin wrote:
    It has been included in several Apple packages dating back to Tiger. However, you have to dig it out of one of the packages in /Library/Receipts. Use the "locate" command and you'll find it in a few packages. Apparently they were using it internally long before they included it in the OS.
    Interesting. The same thing was true for SetFile, which was/is present in Developer Tools. If you hadn't installed the latter, you could still find it in some of the system update for Tiger.
    Using 'defaults' for nested values can be downright painful,
    Yes

  • How to change fcalias www via command line & particular port performance status

    how to change fcalias www via command line & particular port performance status

    how to change fcalias www via command line & particular port performance status

  • How to change maintenance powershell script via GPO?

    Per suggestion reposted from here: http://social.technet.microsoft.com/Forums/windowsserver/en-US/6eece9d6-a524-48aa-8e64-7554f0ec9b31/how-to-change-maintenance-powershell-script-via-gpo?forum=winserverGP
    Posted at http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/desktop-shortcuts-to-items-on-network-drives/94eddb27-342b-40fc-9ad4-677ff4ee8ebe?page=9&tm=1403700614489 originally.
    There is a very annoying "feature" in Windows 7 called BrokenShortcuts.ps1 which is being called out weekly via maintenance task and if it finds more than 4 "broken" network shortcuts it removes them all. So it means if a user at this
    moment is disconnected from the network he will lose all links to shares, network applications sitting on his desktop. Funny that there was no such script on Vista and i don't see this on Win8. On the post i have attached one user suggested to edit this script
    and change 4 to 500 or whatever high number. That's fine for one time fix. But i need to do this for 200+ users. This file cannot be simply replaced by a script, so i'm wondering is there any way to do it via GPO?
    I have already tried various startup scripts, but i'm not sure which user to put into commands.
    I need to run this on startup:
    takeown /F C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1
    icacls c:\windows\diagnostics\scheduled\maintenance\TS_BrokenShortcuts.ps1 /grant "some user":F
    copy \\share\folder$\TS_BrokenShortcuts.ps1 C:\Windows\diagnostics\scheduled\Maintenance\ /Y

    You need to take time to study how Windows does these things.  You can control them with GP which is what you asked.  The article shows you how to disable elements of the tasks.  Each task controls a script.  If you disable the task the
    script that deletes shortcuts will be stopped. Other maintenance tasks will continue to run.
    Most of your problem is that you seem to want someone to provide a magical solution.  In technology it is necessary to fully research your issues until you understand all aspects.  After fully studying the issue you should understand the possible
    solutions if they exist.
    You claim to have deployed the patch that Microsoft released to fix the issue.  You claim it didn't work.  If that is the case then you need to call MS and \p[en a support incident.  If  Microsoft determines that you are right about the
    patch not working you will not be charged for the call.
    I know that learning how to support technology is hard and frustrating for newcomers.  In time, by using these incidents to learn, you will become a seasoned technician and all of this will seem trivial.  Until then we can only suggest that you
    do things that most of us are familiar with.  We cannot fix your network for you.
    I think you haven't really posted in the GP forum but posted a question about GP in the server forum.  Try posting in the GP forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    Here is one answer from the GP forum:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/600ca14f-8b1b-400c-b27f-a7f5733407ac/windows-scheduled-maintenance-task?forum=winserverGP
    ¯\_(ツ)_/¯

  • How do I remove Lotus Notes PDFMaker plugin via command line?

    How do I remove the lotus notes PDFMaker plugin via command line?  I originally deployed Adobe Acrobat 10 as a complete install to many computers.  I see how to remove this specific feature through the GUI in Windows 7 by going to control panel / programs and features / Adobe Acrobat X / change / modify / create adobe PDF / acrobat PDFMaker / Lotus Notes, but this would be a tedious task to do manually at each computer.  I've experimented with a few msiexec commands after removing Acrobat such as:
    msiexec /i "\\path to msi" remove=pdfmakerforlotusnotes
    msiexec /i "\\path to msi" disable_pdfmaker=yes
    Both still install acrobat as a complete install.  Any help and suggestions would be appreciated.  Thank you!

    Thank you Sabian, that did the trick.  Here is the command line I used for anyone else having a similar issue:
    msiexec /i "\\path to msi" REMOVE=PDFMakerForLotusNotes /qn
    I did this on a test machine with a complete Acrobat installed.  I ran the above command and it removed the Lotus Notes PDFMaker plugin.  I should also note that it didn't downgrade my version of Acrobat and all of my custom settings within the application are still there.

Maybe you are looking for