• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drag and drop onto BSD command line tool?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag and drop onto BSD command line tool?


  • Subject: Re: Drag and drop onto BSD command line tool?
  • From: Bob Sabiston <email@hidden>
  • Date: Sat, 17 May 2014 18:54:13 -0500

On May 17, 2014, at 6:26 PM, Kevin Meaney <email@hidden> wrote:

> I think an applescript droplet, using the "on open" call which then calls "do shell script" with the path to your command and the file that is dropped on it.
>
> Kevin


>> You have to create the right kind of Automator workflow for dropping files onto, then you have to select from a popup what to do with the input, then you write your script.
>
> Duh. Step 1.5, you add a "Run Shell Script" action to your workflow.
>

OK thanks — I am trying this and it almost works.  It does run the script, but it is not passing the dropped filename as an argc/argv argument.  The script just reports that it gets no arguments.  I did set “Pass Input” on the “Run Shell Script” to “as arguments”, so it seems like it should work.

Within Automator, you have to add a “Get Specified Finder Items” action before the script, if you want to run it within Automator.   I tried that, and it just doesn’t seem to pass the filename as an argument.   Maybe it is actually passing the *contents* of the dropped file, instead of just its filename?  But my script is reporting no arguments besides the script name.

Bob



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Drag and drop onto BSD command line tool?
      • From: Scott Ribe <email@hidden>
References: 
 >Drag and drop onto BSD command line tool? (From: Bob Sabiston <email@hidden>)
 >Re: Drag and drop onto BSD command line tool? (From: Scott Ribe <email@hidden>)
 >Re: Drag and drop onto BSD command line tool? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Drag and drop onto BSD command line tool?
  • Next by Date: Re: Drag and drop onto BSD command line tool?
  • Previous by thread: Re: Drag and drop onto BSD command line tool?
  • Next by thread: Re: Drag and drop onto BSD command line tool?
  • Index(es):
    • Date
    • Thread