• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CLI open -a myApp fileName - not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CLI open -a myApp fileName - not working


  • Subject: CLI open -a myApp fileName - not working
  • From: David Hoerl <email@hidden>
  • Date: Fri, 16 Jun 2006 21:39:07 -0400

I often use the CLI command "open -a Preview somefile.tif" and it works just fine. When I try it with my app, I get the following:

open -a /fullPathTo/myApp file.tif
2006-06-16 19:31:23.150 open[13149] LSOpenFromURLSpec() returned -1 for application /fullPathTo/myApp path /anotherfullPath/file.tif.


2006-06-16 19:31:23.152 open[13149] Couldn't open file: /anotherfullPath/file.tif

I have verified that when I send this command, that my application never runs at all, so Launch Services has looked at my info.plist (or whatever) and decided its not worth even trying to let my app open this file.

So, I figured this open works with TextEdit (open -a TextEdit somefile.txt) , so I looked at the TextEdit plist file, to make sure I had corresponding information.

This sort of mimiced what TextEdit uses:

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
  <string>tif</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>tif.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
 <string>text/tif</string>
</array>
<key>CFBundleTypeName</key>
<string></string>
<key>CFBundleTypeOSTypes</key>
<array>
 <string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>

In addition, I tried setting NSAppleScriptEnabled to YES or NO - neither setting had any effect.

[I also tried searching the archives for "Launch Services" and "open" but nothing seemed germane to this and you get an awful lot of hits that are not relative.]

I'm at a dead end - any pointers appreciated.

David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: CLI open -a myApp fileName - not working
      • From: Lester Dowling <email@hidden>
  • Prev by Date: Alignment in NSToolbar?
  • Next by Date: Re: Alignment in NSToolbar?
  • Previous by thread: Re: Alignment in NSToolbar?
  • Next by thread: Re: CLI open -a myApp fileName - not working
  • Index(es):
    • Date
    • Thread