|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
League Commissioner
Join Date: Jan 2002
Posts: 7,948
|
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? |
|
|
|
|
|
#3 |
|
League Commissioner
Join Date: Aug 2006
Posts: 5,039
|
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. |
|
|
|
|
|
#4 | |||||||||||||||||||||||
|
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
|
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 |
|||||||||||||||||||||||
|
|
|
|
|
#5 |
|
League Commissioner
Join Date: Jan 2002
Posts: 7,948
|
Ah, but an app that is not "droppable" might also not be script-able. Not all apps are script-able.
|
|
|
|
|
|
#6 |
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,642
|
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
|
|
|
|
|
|
#7 |
|
Major Leaguer
Join Date: Apr 2005
Posts: 477
|
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
|
|
|
|
|
|
#8 |
|
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 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|