New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.4 - "Open With" On mac OS


Post Reply New Thread Subscribe

 
Thread Tools
CoolK

 
Member Since: Apr 08, 2009
Posts: 4
CoolK is on a distinguished road

CoolK is offline
i have created a Mac OS application using XCode to Compile and Qt Frameword to develop

i am facing a major problem regarding the "open with" command on Mac OS

first of all , my application is supposed to support type files such as "djf" files



if i open my program and work on it for a while , the user has the option to save his work file as djf files

now if the user clicks back on the djf file , my application is supposed to open and load the djf file clicked by the user


the first problem that i am facing is that , the "open with" command on MAC OS is graying out my application so the user has to change the options on the top from "Recommended applications" to "all applications" so that the user will be able to click on my application and select it


the second problem that i have is that even though the user selects my application, my application opens a new instance of it self rather than loading the file being passed as an argument using the command line


i did few tests on my application and i found that my application never receives the file name as an argument in the main.cpp and that was the reason of why it doesnt load the file

i did few more tests using the command line of mac OS where a user can simply say:

open -a [application path/application.app] [argument "file name"]

i noticed that my application never receives [argument "file name"]

then i noticed that if you remove "open -a" from the command line and just keep [application path/application.app] [argument "file name"] while diving in to the application.app/Contents/MacOS/applicationName

this will certainly pass all the parameters needed and my application will load the saved work document to be edited once again

so i am pretty confused , why "open -a" is not passing the right arguments

please note: that open -a only passes two arguments to my application
1- the application path
2- a wierd argument which says "psn_0_xxxxxx"

but as soon as you type in the command line

application.app/Contents/MacOS/applicationName [filename]

this will pass the right arguments to my application

if some one can answer my question that would be great

thanks
QUOTE Thanks
Neo

 
Neo's Avatar
 
Member Since: Aug 14, 2007
Posts: 557
Neo is a jewel in the roughNeo is a jewel in the rough
Mac Specs: white MB 2.16GHz 3GB 320GB 10.6.1

Neo is offline
What is your question?
QUOTE Thanks
CoolK

 
Member Since: Apr 08, 2009
Posts: 4
CoolK is on a distinguished road

CoolK is offline
the question is

how can you open a file type with a specific application

because its not working for me
QUOTE Thanks
Nethfel

 
Member Since: Feb 25, 2009
Posts: 2,102
Nethfel is a glorious beacon of lightNethfel is a glorious beacon of lightNethfel is a glorious beacon of lightNethfel is a glorious beacon of lightNethfel is a glorious beacon of lightNethfel is a glorious beacon of light
Mac Specs: Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10

Nethfel is offline
I don't know much about OSX programming, but you may have to do something, perhaps a plist or something, that notifies the system that your program should be associated with those files.

Unfortunately, your question extends beyond the just open a file with a specific app, since you are able to do that but it is launching your program in a separate instance (which also might imply that you may have to identify if your program is already running and pass the handle to the existing instance of your app).

Unfortunately, your question is more suited to a developer forum rather then a users forum Have you given apples developer forums a try on your question? I know Apple has a set, and there are a few other forums out there for OSX developers (doing a quick google search on OSX Developer forum) - you might be able to get a more accurate response to your issue...

My Macs: Late 2013 rMBP w/ 750m; Mac mini G4, 1.25 GHz, 512m ram (server); Late 2011 11" MBA, 1.8GHz i7, 4Gig Ram, 256Gig SSD, HD3000; Powerbook 12" G4 1.33GHz running Debian as a server; Apple TV (1080p version)
QUOTE Thanks
CoolK

 
Member Since: Apr 08, 2009
Posts: 4
CoolK is on a distinguished road

CoolK is offline
thanks a lot Nethfel I'll try that out

maybe the MacOS forum is the place where to post such question
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,827
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
This is something that has to be set programmatically (I think). I would also suggest going to a forum that talks specifically about Qt or a Qt mailing list. I'm sure Trolltech/Nokia has one.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
CoolK

 
Member Since: Apr 08, 2009
Posts: 4
CoolK is on a distinguished road

CoolK is offline
i have done this already and i am going to let you know if i find a solution to benefit every one
QUOTE Thanks

Post Reply New Thread Subscribe


« Another Partial TimeCapsule Restore | Revert OSX »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
At my wits end with my Mac... christianhough Switcher Hangout 31 01-28-2009 09:32 PM
Has The Mac Been Hacked...... MaDDoG Apple Rumors and Reports 5 05-01-2007 07:06 PM
To Mac Pro or not to Mac Pro? london Switcher Hangout 32 08-21-2006 11:57 PM
Switcher Article in Today's Times studio34 Switcher Hangout 9 08-11-2006 03:10 PM
It's called a Mac iSheep Schweb's Lounge 22 10-13-2004 05:35 PM

All times are GMT -4. The time now is 05:16 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?