New topic: 

File Associations on Mac

<http://forums.realsoftware.com/viewtopic.php?t=47643>

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        Charlie          Post subject: File Associations on MacPosted: 
Fri Apr 19, 2013 5:08 am                         
Joined: Thu Feb 28, 2013 6:21 pm
Posts: 7                Looking for some help on associating files with my app. 
I'm using RB2012 2.1. 

Basically my app uses SQLite databases as its document. I am using P1D as the 
filename extension. I have set up a FileType object as follows:

Display Name: P1D Document
Object Name: p1dDocument
MacType: P1D
MacCreator: CSPO
Extensions: p1d
UTI's" com.mycompany.myproduct
Icon: (Full set of icons added)

In my app i have "AcceptFileTypes" set to "FileTypes.p1dDocument" checked and 
the role set to editor and in "ApplicationIdentifier" I have 
"com.mycompany.myproduct"

Built the app (Cocoa) but the file association does not seem to have been made. 
No icon on the file and it does not launch the app unless in finder I manually 
change the "Opens With" to my app. I have the code set up in the OpenDocument 
event of my app which works fine as I say if I manually set up the "Opens With" 
in finder.

Surely this should be simple..... Pulling my hair out... What have I missed?   
                             Top                Stuart J Sykes          Post 
subject: Re: File Associations on MacPosted: Fri Apr 19, 2013 5:46 am           
              
Joined: Fri Oct 26, 2012 6:24 am
Posts: 72                Hi Charlie,
When I did my Notepad Application (load a .txt document into the app when 
double clicked) I had to add information into the Event Handler -  App 
(OpenDocument) section, i am suspecting that this is what you need to do.
Your database file will be the "item" which is a folderitem you will need to 
load.
Here's an example...http://docs.realsoftware.com/index.php/ ... ment_event      
_________________
Stuart J Sykes - www.real-soft.co.uk
Mountain Lion 10.8.2 (Real Studio 2012 2.1)  
                             Top                Charlie          Post subject: 
Re: File Associations on MacPosted: Fri Apr 19, 2013 8:00 am                    
     
Joined: Thu Feb 28, 2013 6:21 pm
Posts: 7                Stuart

As I said in my post I have the code to open the file and read it into the app 
when it is double clicked and that's fine. It's just associating the file with 
my app that I'm having problems with. Ie finder does not know it should launch 
my app when a file is double clicked on. 

Thanks   
                             Top                npalardy          Post subject: 
Re: File Associations on MacPosted: Fri Apr 19, 2013 9:49 am                    
   Real Software Engineer          
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7780
Location: Canada, Alberta, Near Red Deer                This is something that 
has totally changed over the years and is NOT handled by the IDE.
(It used to be but since Apple has completely revised the system it's not yet 
been updated)

You will need to do some manual work on the applications PLIST to tell the OS 
that YOUR application owns those files & that it should be the one that handles 
them being double clicked.

This used to be handled entirely by simply setting the TYPE & CREATOR codes - 
but Apple has deprecated that in favor of a different system.

There are some tools, like AppWrapperhttp://www.ohanaware.com/appwrapper/ that 
can help you set this up
What you're specifically interested in is UTI's      
_________________
Norman Palardy (Real Software)
––––––––––––––––––––––––––––––––––––––––––––––––––
Real Studio Developer Conference - April 23 - 26, 2013
http://www.realsoftware.com/community/realworld.php  
                             Top                Axel-Erfurt          Post 
subject: Re: File Associations on MacPosted: Fri Apr 19, 2013 10:15 am          
               
Joined: Fri Nov 16, 2012 8:10 pm
Posts: 28                Charlie wrote:finder does not know it should launch my 
app when a file is double clicked on. 

select a file ---  cmd + I 
in the Info window --- select your app (open with)
click change all

all files with the same extension will be opened with your app.   
                             Top                Charlie          Post subject: 
Re: File Associations on MacPosted: Fri Apr 19, 2013 10:43 am                   
      
Joined: Thu Feb 28, 2013 6:21 pm
Posts: 7                Alex, that is what I want but I should be able to do it 
in code. When my user installs my app they don't want to have to go to the file 
and tell OSX what application should be used to open it.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to