Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 04-22-2012, 01:38 PM   #1
HippoMan
Major Leaguer
 
Join Date: Apr 2007
Location: [No longer use a Mac. Last Mac I owned: Unibody MacBook Pro, MacOS 10.8.2]
Posts: 316
Lion: turning a non-droplet into a droplet?

I'm running Lion, and I'm wondering if any of you know any tricks or hacks that will turn a non-droplet into a droplet.

Here's an example of a specific case:

The program "Avidemux" is not a droplet. In other words, I can't drop a video on the app in order for it to process the video, nor can I click on the video and use "Open with..." to get Avidemux to open it. The only way to get Avidemux to process a video is to open Avidemux and then get to the video via its "File" menu.

What I'm looking for is some sort of wrapper program that I can put around Avidemux so that I can drop a video on it or use "Open with..." to get Avidemux to process it.

To be clear, this is not simply for Avidemux, and I'm just referring to it here as an example. I'm trying to figure out to do this for any non-droplet.

And again to be clear, I realize that any method for doing this is likely to be a trick or a hack, and that's OK with me.

Thanks in advance for any suggestions.
.
__________________
I got rid of my Mac for good.
This thread explains why: http://hintsforums.macworld.com/showthread.php?t=168164
The last Mac that I owned:
Unibody MacBook Pro, MacOS 10.8.2
HippoMan is offline   Reply With Quote
Old 04-22-2012, 02:23 PM   #2
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 8,501
I don't know anything about changing a 'non-droppable' app to a "droppable" app, but doesn't that work to right-click your video file, choose "open with...", then choose "Other", and browse to Avidemux? You can force it by changing the drop down in the browse window to show All Apps, not just Recommended Apps...
What happens when you try that?
DeltaMac is offline   Reply With Quote
Old 04-22-2012, 03:03 PM   #3
benwiggy
League Commissioner
 
Join Date: Aug 2006
Location: London
Posts: 5,753
It entirely depends upon the app.

Some apps are built to process files when they are dropped on. Some aren't.

If the app is AppleScript-able, you could create an AppleScript droplet that calls the app and passes the file to it.

But if an app is designed to work in a certain way, then short of rewriting it, there's not a lot you can do to alter the way it functions.
benwiggy is offline   Reply With Quote
Old 04-22-2012, 08:45 PM   #4
HippoMan
Major Leaguer
 
Join Date: Apr 2007
Location: [No longer use a Mac. Last Mac I owned: Unibody MacBook Pro, MacOS 10.8.2]
Posts: 316
Quote:
Originally Posted by benwiggy
It entirely depends upon the app.
...
But if an app is designed to work in a certain way, then short of rewriting it, there's not a lot you can do to alter the way it functions.

Thank you. Yeah, that's what I was afraid of.

Hmm ... actually, maybe there is a way. How does this sound? ...

What if I figure out how to write an AppleScript to open the app, click on the "File" menu, select "Open", paste the name of a given file into the dialog box, and then click on "OK".

Then, I can encode this AppleScript in an ASOC droplet. The file name can be gotten when the ASOC droplet is run via "Open with..." or by dropping a file onto it. Then, I could feed the file name to the AppleScript code that I described above.

It seems like a lot of work, but maybe I could get something like this going.

Do any of you see any pitfalls?

I'm going to try it next weekend, and I'll report back here with my findings.
.
__________________
I got rid of my Mac for good.
This thread explains why: http://hintsforums.macworld.com/showthread.php?t=168164
The last Mac that I owned:
Unibody MacBook Pro, MacOS 10.8.2
HippoMan is offline   Reply With Quote
Old 04-22-2012, 08:55 PM   #5
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 8,501
Ah, but an app that is not "droppable" might also not be script-able. Not all apps are script-able.
DeltaMac is offline   Reply With Quote
Old 04-22-2012, 08:55 PM   #6
NaOH
Hall of Famer
 
Join Date: Dec 2007
Posts: 3,813
You could try a script like this to open the selection with Avidemux, though I'm not certain if it will work because I'm wondering if Avidemux is an X11 appliction and I don't know if such a script works with those.

Code:
property the_app : "Avidemux"

tell application "Finder"
	set the_selection to the selection
end tell

repeat with each_item in the_selection
	do shell script ("open -a " & (quoted form of the_app) & space & (quoted form of (POSIX path of (each_item as alias))))
end repeat
If it does work, you may want to also have a look at FastScripts (free for 10 scripts). It's a menu bar application which will enable you to run the script with a keyboard shortcut you define. I do the same thing using a different application and the method works well for me (e.g., when I want to open an image in an editor instead of Preview, or a movie in VLC instead of QuickTime, etc.).
NaOH is online now   Reply With Quote
Old 04-23-2012, 10:32 AM   #7
regulus6633
Major Leaguer
 
Join Date: Apr 2005
Posts: 478
I believe you could gui-script this action. I've done something similar for a non-applescriptable application. I modified the code so this should work for you.

NOTE: just change the "appName" variable to the name of the application you want this to work with.

NOTE: if you save this code as an application the you can either 1) drop files onto it or 2) double-click it and you are presented with a dialog box where you can choose a file. So it works 2 ways to make it flexible.

NOTE: the myDelay variable is important. It defines the number of seconds to wait between each step... so if you're having trouble you can increase this and see if that makes a difference. Also if all works well you can decrease this to make the script run faster. Play with it to customize it for your situation.

Good luck!
Code:
property appName : "Safari"
property myDelay : 0.4

on run
	-- get the file
	set theFile to choose file
	openFile(theFile)
end run

-- files are dropped
on open droppedFiles
	repeat with theFile in droppedFiles
		openFile(theFile)
		delay myDelay
	end repeat
end open

on openFile(theFile)
	tell application appName to activate
	delay myDelay
	tell application "System Events"
		tell process appName
			keystroke "o" using command down
			delay myDelay
			keystroke "g" using {shift down, command down}
			delay myDelay
			set f to POSIX path of theFile
			keystroke f
			delay myDelay
			keystroke return
			delay myDelay
			keystroke return
		end tell
	end tell
end openFile
__________________
Hank
http://www.hamsoftengineering.com
regulus6633 is offline   Reply With Quote
Old 04-28-2012, 11:07 AM   #8
HippoMan
Major Leaguer
 
Join Date: Apr 2007
Location: [No longer use a Mac. Last Mac I owned: Unibody MacBook Pro, MacOS 10.8.2]
Posts: 316
Thanks to NaOH and regulus6633.

To NaOH: your suggestion only works if the program in question optionally takes a file name on the command line. Not all do that, but for those which do, it's definitely a good solution.

To regulus6633: yes, this is more or less what I was talking about in my latest message. Your suggestion will save me trial-and-error time.

Thanks again to both of you!
.
__________________
I got rid of my Mac for good.
This thread explains why: http://hintsforums.macworld.com/showthread.php?t=168164
The last Mac that I owned:
Unibody MacBook Pro, MacOS 10.8.2
HippoMan is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump



All times are GMT -5. The time now is 11:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.