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 - Development and Darwin Discussion and questions about development for Mac OS X.

How to define a new file association with a binary application (not a .App) ?


Post Reply New Thread Subscribe

 
Thread Tools
redvivi

 
Member Since: May 20, 2009
Posts: 7
redvivi is on a distinguished road

redvivi is offline
Hello !

I installed wine from MacPorts (the only one to work) and I'm a bit tired to open a Terminal to open Wine, is there a way to define a new file association to automatically open *.exe file with /opt/local/bin/wine (it's not possible with the built-in application selector on MacOSX) ?

Cheers,
Vianney
QUOTE Thanks
Lifeisabeach

 
Lifeisabeach's Avatar
 
Member Since: Sep 30, 2007
Location: Wilmington, NC
Posts: 7,003
Lifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond repute
Mac Specs: iMac i3 (mid-2010) + OS 10.9; TV 3; iPhone 5S; iPad 4

Lifeisabeach is offline
You could probably create an Automator workflow to automate this somehow. I'm not near my Mac at the moment so I can't give any more specific ideas on how to configure that workflow for now.


Please verify and include the exact model/year of your Mac and OS X version number (available from "About This Mac", then "More Info" on the Apple menu).
------
Links: Onyx | EasyFind | Apple Hardware Test | How to test your hard drive | The Safe Mac Adware Removal Guide | Uninstall MacKeeper
------
Lifeisabeach - Mac-Forums Member of the Month June 2009, Feb 2012, and March 2013.
QUOTE Thanks
redvivi

 
Member Since: May 20, 2009
Posts: 7
redvivi is on a distinguished road

redvivi is offline
I tried to do it with Automator but I'm a kind of noob in AppleScript
QUOTE Thanks
Haravikk

 
Member Since: Mar 24, 2008
Posts: 6
Haravikk is on a distinguished road

Haravikk is offline
I'd like to bump this to see if anyone has any ideas or sample scripts. I don't really know what I'm doing with AppleScript to be honest, though it seems like it should be simple enough I don't really want to have to learn AS just to get it done.

Being able to double-click .exe files and then create a dummy drive for WINE are my two main wishes for making integration almost seamless, and IMO what they need for any binary distributions that come along in the future, as navigating to ~/.wine/ to get at your "C:" drive is a bit of a pain, and having to fire into the terminal to open an application is a bit too. The drive one is solved easily enough by throwing it in the sidebar and giving it a nice OS X drive icon though, but me being picky I'd prefer to see it under the devices heading

Though on the plus side everything I want to run seems to run much better in WINE than it ever has in VMWare Fusion or Parallels, so it's been worth the effort so far!

"Early 2008" MacPro: 2 x 3.2ghz Quad-Core Xeons (12mb cache)
10gb DDR2 800mhz RAM (ECC)
4 x 750gb SATA 2 drives (32mb cache) - RAID 0
NVidia GeForce 8800GT (512mb)
QUOTE Thanks
Haravikk

 
Member Since: Mar 24, 2008
Posts: 6
Haravikk is on a distinguished road

Haravikk is offline
Okay, so I went ahead and made something myself. All you have to do is open a new Automator application workflow, throw in a shell-script task, and copy/paste the following code:

Code:
source ~/.profile
if test $# = 0
	then
		winefile C:
		exit
fi

for f in "$@"
do
	d=`dirname "$f"`
	f=`basename "$f"`
	cd "$d"
	wine "$f" &
done
You can then save your app, associate .exe files with it (using Finder's get-info), and WINE should run with very little fuss as you can now just double-click .exe files, create aliases to your favourite ones etc.

If you open the app without a .exe argument then you get the default file-browser. You can also go a step further and associate files in the info.plist within the .app, and provide icons and so-on as well, but I won't describe that here.

"Early 2008" MacPro: 2 x 3.2ghz Quad-Core Xeons (12mb cache)
10gb DDR2 800mhz RAM (ECC)
4 x 750gb SATA 2 drives (32mb cache) - RAID 0
NVidia GeForce 8800GT (512mb)
QUOTE Thanks

Post Reply New Thread Subscribe


« NSString containing IvP4 of machine | Bug in WebView cocoa? »
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
Global change of file icons based on Application forbin OS X - Operating System 0 02-02-2005 06:59 PM
file type association gdestiny Switcher Hangout 3 01-28-2005 11:34 AM
Change application to open file types? sunmike Running Windows (or anything else) on your Mac 3 01-04-2005 12:51 PM
Finding a file (application) WhitE_RabbiT OS X - Development and Darwin 1 08-05-2004 02:03 PM
File association errors pixelmaven Apple Notebooks 4 04-09-2004 08:50 PM

All times are GMT -4. The time now is 10:56 AM.

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?