Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

allowing files to be dropped on your apps icon in OS X to ..

 
   Macintosh computer (Home) -> Tools RSS
Next:  PackageMaker  
Author Message
Eric13

External


Since: Feb 24, 2004
Posts: 8



(Msg. 1) Posted: Tue Feb 24, 2004 11:55 am
Post subject: allowing files to be dropped on your apps icon in OS X to au
Archived from groups: comp>sys>mac>programmer>tools (more info?)

I cannot find out how you allow your app's icon in OS X to allow files
to be dropped on it causing it to run the app and auto load the files.
I am guessing that the files will show up as command line parameters
in argv. However when I drag some tiff files overs my viewer it will
not launch it. It is as if I have to tell the app that it can open
them, or associate tiffs with that app, or something. Thanks for any
help you can provide.

P.S. This is also posted in the wxwindows news group.

 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Miro Jurisic

External


Since: May 10, 2004
Posts: 973



(Msg. 2) Posted: Tue Feb 24, 2004 4:52 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <a6af27e.0402240855.1374a0d3.TakeThisOut@posting.google.com>,
emedlin.TakeThisOut@myrealbox.com (Eric) wrote:

 > I cannot find out how you allow your app's icon in OS X to allow files
 > to be dropped on it causing it to run the app and auto load the files.
 > I am guessing that the files will show up as command line parameters
 > in argv. However when I drag some tiff files overs my viewer it will
 > not launch it. It is as if I have to tell the app that it can open
 > them, or associate tiffs with that app, or something. Thanks for any
 > help you can provide.

You need to add the information about file types you accept to your app's
Info.plist file, and then you have to write an Apple Event handler that accepts
those files and opens them..

hth

meeroh

--
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Eric13

External


Since: Feb 24, 2004
Posts: 8



(Msg. 3) Posted: Wed Feb 25, 2004 10:03 am
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Miro Jurisic <macdev.TakeThisOut@meeroh.org> wrote in message news:<macdev
 > You need to add the information about file types you accept to your app's
 > Info.plist file, and then you have to write an Apple Event handler that accepts
 > those files and opens them..
 >
Do you have a link that talks about adding this to the Info.plist file
and creating the Apple Event handler?<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Eric13

External


Since: Feb 24, 2004
Posts: 8



(Msg. 4) Posted: Wed Feb 25, 2004 3:37 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Miro Jurisic <macdev.DeleteThis@meeroh.org> wrote in message news:<macdev-22F05E.13523324022004.DeleteThis@senator-bedfellow.mit.edu>...
 > You need to add the information about file types you accept to your app's
 > Info.plist file, and then you have to write an Apple Event handler that accepts
 > those files and opens them..
 >
 > hth
 >
 > meeroh

I have added the following to my Info.plist file.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>tiff</string>
<string>tif</string>
</array>
<key>CFBundleTypeName</key>
<string>NSTIFFPboardType</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
I though this would allow the App bundle to late *.tiff and *.tif
files to dropped on it. I have not implmented the event handler yet,
but I would think I could drop the file on the App would and it would
launch but would not load the files since I have not wrote the handler
yet. I have also learned of a function called wxApp::MacOpenFile that
I can overide that should catch the apple even you are talking about.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Eric13

External


Since: Feb 24, 2004
Posts: 8



(Msg. 5) Posted: Wed Feb 25, 2004 4:02 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Never mind my last post. I don't why my Info.plist file was not
letting my app let me drag and drop files on it before but now it
does. Anyway I just need to catch the event with MacOpenFile or some
other function. wxApp::MacOpenFile does not seem to be getting called
for me though.
 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Eric13

External


Since: Feb 24, 2004
Posts: 8



(Msg. 6) Posted: Wed Feb 25, 2004 4:33 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Miro Jurisic

External


Since: May 10, 2004
Posts: 973



(Msg. 7) Posted: Wed Feb 25, 2004 5:37 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <a6af27e.0402250703.5575190d.TakeThisOut@posting.google.com>,
emedlin.TakeThisOut@myrealbox.com (Eric) wrote:

 > Miro Jurisic <macdev.TakeThisOut@meeroh.org> wrote in message news:<macdev
  > > You need to add the information about file types you accept to your app's
  > > Info.plist file, and then you have to write an Apple Event handler that
  > > accepts
  > > those files and opens them..
  > >
 > Do you have a link that talks about adding this to the Info.plist file
 > and creating the Apple Event handler?

<http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Con
cepts/infoplist.html>,
<http://developer.apple.com/samplecode/Sample_Code/OS_Utilities/MiniShell/MiniShe
ll.c.htm>

Note that the way the latter example converts the FSRef to a path is broken, and
you should ignore it.

hth

meerho

--
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Miro Jurisic

External


Since: May 10, 2004
Posts: 973



(Msg. 8) Posted: Wed Feb 25, 2004 5:37 pm
Post subject: Re: allowing files to be dropped on your apps icon in OS X t [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <a6af27e.0402250703.5575190d.TakeThisOut@posting.google.com>,
emedlin.TakeThisOut@myrealbox.com (Eric) wrote:

 > Miro Jurisic <macdev.TakeThisOut@meeroh.org> wrote in message news:<macdev
  > > You need to add the information about file types you accept to your app's
  > > Info.plist file, and then you have to write an Apple Event handler that
  > > accepts
  > > those files and opens them..
  > >
 > Do you have a link that talks about adding this to the Info.plist file
 > and creating the Apple Event handler?

<http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Con
cepts/infoplist.html>,
<http://developer.apple.com/samplecode/Sample_Code/OS_Utilities/MiniShell/MiniShe
ll.c.htm>

Note that the way the latter example converts the FSRef to a path is broken, and
you should ignore it.

hth

meeroh

--
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: allowing files to be dropped on your apps icon in OS X to .. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
adding an icon into an AppleScript Studio Project - i'd like adding an icon "ultrid_demo.icns" to an AppleScript Studio Project. i have added this line : CFBundleIconFile = "Resources/ultrid_demo.icns"; to my "infoPlist.strings" and also in the info.plist but the app still...

Porting your Cocoa Apps to Sharp Zaurus - Dear developers, please note that we are developing a suite to extend the Cocoa API to ARM based handhelds. The latest Developer Release DR2 of myPDA-Zaurus-Edition can be found at http://www.dsitri.de/wiki.php?page=myPDA-Zaurus-Edition We would be..

How to distribute patches (updates) of existing apps (bund.. - The topic says everything. I've seen there is a tool called ipatch (www.ipatch.org) but despite the ..org suffix it's commercial, something similar free or something available at OS level, like the package manager. Bye, Gabry

GDB & ELF files - I was trying to use an AVR simulator. The simulator acts as a client for gdb and you use gdb to load the exceutable (in this case an ELF file from avr-gcc) then gdb will control the simulator running the code. The gdb in OS X 10.3.6 (Xcode 1.5) doesn't...

[MPW] Copy files with MPW - Hi everybody does somebody know if there is a command in MPW to copy files and folders ? I found the "move" command to move files and folders, the "copy" command to copy the selection to the clipboard, but nothing to copy files, w...
   Macintosh computer (Home) -> Tools All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]