AppleScript drag-and-drop interface to shell script

This is actually a cross-over question with AppleScript, but I'll try here first since I don't visit the AppleScript forum very often...
I have a shell script which takes as a parameter a file name and does something interesting with the file, but generates no terminal output except for a possible error message. What I'm looking for is an AppleScript script that would, at the Finder level, allow me to drag and drop a file onto it causing it to run my shell script passing to it the name of the file.
Having very limited experience with AppleScript, I'm hoping someone has something similar that they'd be willing to offer up.

Hi Ken,
   The following is a script I wrote as a test a while back. It's pretty simple so I imagine you can edit it to suit you needs.
on open filelist
   repeat with i in filelist
      do shell script "echo " & POSIX path of i & " >>~/out.txt"
   end repeat
end open
Gary
~~~~
   Give me your students, your secretaries,
   Your huddled writers yearning to breathe free,
   The wretched refuse of your Selectric III's.
   Give these, the homeless, typist-tossed to me.
   I lift my disk beside the processor.
         -- Inscription on a Word Processor

Similar Messages

  • When i drag and drop an image on my site. it gives the following error. "Unable to access local files due to browser security settings. To overcome this, follo"

    I am using the firefox version 17 and when i drag and drop an image on my website. It gives me the following error.
    Unable to access local files due to browser security settings. To overcome this, follow these steps: (1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again. Or go to the homepage for a link to the tutorial on how to do it.
    I have completed the above steps and it is still showing the same error message. Any help would be highly appreciated.
    Thanks.

    Thanks kumars ,
    I have a specific drag and drop area on our website. This works fine for all earlier releases of Firefox after these security settings
    "(1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again."
    Bust these settings not work for me in Firefox 17.
    Yes the drag and drop functionality is java script based and i am not using any script blocker addons.

  • Drag and drop panel

    I plan on writing a "drag and drop" interface that lets a user place things on a "canvas" and move them around. I will then let the user connect them with lines. Such things could be nodes in a network, one of the ideas I've had for using it. Basically this will allow visualization of whatever is happening behind the scenes, such as routing algorithms (etc).
    My plan at the moment is to have a canvas class and a can-be-placed-on-canvas class. The canvas object is in charge of handling the mouseclicks and moving of the objects. It will have an add() method which lets you add the objects to visualize, probably storing them in a collection.
    The objects placed on the canvas will have some form of .draw() method that returns what should be drawn to visualize them. I'd like to separate this away from the canvas so that different objects can be drawn.
    The problem I'm having at the moment is the actual dragging and dropping of the items. I could iterate over every object and see if it appears where the user is clicking, perhaps by comparing object.left + object.width and object.top + object.top to see if it encompasses the cursor. Surely this will be slow though and I'm not sure it would be the most efficient way of doing it.
    Another problem is z-order, I could assume that items are drawn according to their position in the collection. Then, when checking where a user clicks, iterate over the collection backwards as the item "on top" will be the first one found when going in the backward direction.
    I am presuming I will use a Graphics2D as the canvas, encompassed in a JComponent with an overridden .paint(). However, if this isn't the best way any other ideas would be nice.
    Before I start coding, does anybody have any ideas how I could design this if my suggestions do not make sense? Or are there are any significant flaws in the way I plan to do it?
    Thanks.

    So you are suggesting I use JComponent (which makes
    sense) and add a listener to it? That listener could
    probably be the canvas, which would then handle the
    dragging and dropping. I could also override paint()
    (including calling super.paint(), as I've found I have
    to do from past experience) in order to give my
    components the look I want.Yeh, Something like that. Everything you want to draw on your Canvas should be derived from JComponent
    (perhaps even JButton (depends on what you want to do)). The listener can be the JCanvas or perhaps
    a set of seperate behaviour classes that implement dragging (and optionally other behaviours such as
    context sensitive popup menus). Or you could have multiple listeners for different aspects of the behaviour
    Thanks for your suggestions, I guess the only
    difficulty now would be implementing the moving. Any
    ideas how the moving could be done?Make a single mouseListener. Register it with all the JComponents and listen for the MouseEvent.MOUSE_DRAGGED Event. When this occurs you obtain the Source of the event and change
    its coordinates (using setLocation or reshape)
    matfud

  • Implementing Drag and Drop

    I would buy this product if the ajax features somehow
    supported the implementaion of drag and drop in a way that was
    simple to use.
    I am dabbling in vb.net/asp.net and its version of ajax
    tools. The support for drag and drop are not all that good at this
    time.
    I have even bought a book that had a chapter on it. It still
    takes too much java hand written code to impliment it.
    I also own dreamweaver MX. I use this product to do all my
    web sites. They all are home stuff and fun stuff. My wife wants her
    site to have the user be able to grab an object and drop it on a
    specific location and have an event occur. In her case she wants an
    animated GIF to fire.
    I have turned to vb.net because i am a programmer and use
    vb.net for application development. But!!! i am excited about DW
    cs3. So my question is!!
    Does DW CS3 Ajax tools provide a somewhat easy way to
    impliment drag and drop without me having to write to much Java by
    hand?
    Thanx up front
    jerryCic

    >I would buy this product if the ajax features somehow
    supported the
    > implementaion of drag and drop in a way that was simple
    to use.
    Drag and Drop interfaces in javascript are nothing simple.
    Don't expect any
    magic wizards to help you with this.
    There are a lot of AJAX/JS libraries. Many have DnD featuers,
    but they'll
    differ from library to library. you're going ot have to do a
    lot of legwork
    and takea look at them all.
    I've used Scriptaculous in the past, but have found it
    limiting. I'm going
    to be looking at Jquery UI next.
    > Does DW CS3 Ajax tools provide a somewhat easy way to
    impliment drag and
    > drop
    > without me having to write to much Java by hand?
    Java is not involved. JAVASCRIPT is.
    DW does not do .net, so you you're going to do .net, you
    should look at
    Visual Studio as your main development IDE.
    _Darrel

  • Java script- drag and drop

    Can i use java scripte to do a drag&drop interface?I want to move a picture(.jpg or.gif) to anywhere on ie.

    There are drag and drop functions in DHTML that you can use in Javascript :
    ondrag
    Fires on the source object continuously during a drag operation.
    ondragend
    Fires on the source object when the user releases the mouse at the close of a drag operation.
    ondragenter
    Fires on the target element when the user drags the object to a valid drop target.
    ondragleave
    Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
    ondragover
    Fires on the target element continuously while the user drags the object over a valid drop target.
    ondragstart
    Fires on the source object when the user starts to drag a text selection or selected object.
    ondrop
    Fires on the target object when the mouse button is released during a drag-and-drop operation.

  • I would like to build a drag n drop interface and have the results sent to my email in PDF format. Is this possible?

    I would like to build a drag n drop interface and have the results sent to my email in PDF format. Is this possible?

    Captivate is not really designed to do what you want in this instance.  It's more targeted at allowing a user to complete an assessment and then track whether or not they passed.  So it's only really set up to send information in a format that the LMS will understand and interpret as Pass/Faill and what the score was.
    You really need something more flexible than that. So I think you would need to get a programmer involved and have the solution custom made.  In my experience, any time you try to diverge Captivate from what it was designed to do, and you need to get other IT professionals involved, you can kiss thousands of dollars goodbye before you have a workable solution.

  • Gnome-shell and xfburn - drag-and-drop no longer supported

    Can someone using gnome-shell else try this as a sanity check:  try to drag-and-drop an mp3 file into xfburn in "Audio CD" mode.  For me, mp3 files are ignored but wav files drag-and-drop in just fine.  I can add mp3 files to the compilation but only if I do so through the xfburn GUI.

    I get the same behavior here.

  • Scripting Error in drag and drop of the UIelements

    Hi,
    This is ashwin ,iam new to webdynpro abap ,as iam started in uidevelopement trying to drag and drop uielement into layout its is showing error while iam dragging and droping the uielement like scripting error.
    can any one help mi what that scripting error could be rectified?
    Regards,
    Ashwin

    Hi,
    Thanks fo rthe reply ,i tried on st22 its showin no error .Iam getting a popup saying error as "__ERROR HAS OCCCURED IN THE SCRIPT OF THE PAGE".
    I am using IE 7 Browser and having high internet connection, iam not understanding why am i unable to drag and drop  UIElements on the layout ?
    Regards,
    Ashwin

  • Drag and Drop UI Scripting?

    Some (unscriptable) applications such as iMovie rely on drag and drop for key functions.
    Is there way to do drag and drop using UI Scripting?

    If there's a way to do that, I would be extremely happy to learn it.

  • Are there any events to script a component when dragged and dropped into the parsys area?

    are there any events to script a component when dragged and dropped into the parsys area?

    The cq:listeners node of a component's cq:EditConfig has a number of events that fire with relation to the edit mode drag'n'drop stuff. You would probably want to hook one or more of the insert ones (beforeinsert, beforechildinsert, afterinsert, afterchildinsert).

  • Setting drag and drop components using script

    Hi,
    Is there a way to set the drag object name and target name of
    the Drag and Drop component using actionscript? I have looked
    through the help files and there is no mention of how to do this. I
    cannot find any methods relating to the Learning Interactions
    either. Can this be done or am I trying to do something that Flash
    is not capable of?
    The reason I wish to do this is so I can retrofit the D&D
    component into existing code. The existing code generates new
    object/target pairs and stores them in an array. I need to be able
    to read these values and plug them into the component at runtime.
    Any ideas?
    TIA
    Colin

    What about the product documentation ?
    http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_dnd.htm#CIHCHGIF
    Also, the following book:
    has a chapter (chapter 14) on drag and drop
    http://www.amazon.com/Oracle-Fusion-Developer-Guide-Applications/dp/0071622543/ref=sr_1_cc_1?s=aps&ie=UTF8&qid=1343975521&sr=1-1-catcorr&keywords=Oracle+Fusion+Developer+Guide
    Frank

  • My MBP won't drag and drop unless I put it to sleep.  What's the problem?

    I have a 17" MBP running Mountain Lion and I cannot drag and drop unless I first put it to sleep.  Any idea what I can do to fix that?  Is there a patch... or maybe a corrupted file?  I recently had it serviced and they reinstalled Mountain Lion, but the problem still exists.
    Any help appreciated.
    Robert Stull
    Bluetrane60

    Please read this whole message before doing anything.
    I've tested these instructions only with the Safari web browser. If you use another browser, they may not work as described.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click anywhere in the line of text below on this page to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -ef 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. If the command produced no output, the window will be empty. Post the contents of the TextEdit window (not the Terminal window), if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; echo; sudo defaults read com.apple.loginwindow LoginHook; echo; sudo crontab -l; } 2> /dev/null | open -ef 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    { launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}'; echo; crontab -l 2> /dev/null; } | open -ef 
    Step 4
    ls -A /e*/{cr,la,mach}* {,/}Lib*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts .la* 2> /dev/null | open -ef  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of login items' | open -ef 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • Problems with ListViews Drag and Drop

    I'm surprised that there isn't an Active X control that can do this more
    easily? Would
    be curious to find out if there is - although we aren't really embracing the
    use of
    them within Forte because it locks you into the Microsoft arena.
    ---------------------- Forwarded by Peggy Lynn Adrian/AM/LLY on 02/03/98 01:33
    PM ---------------------------
    "Stokesbary, Michael" <[email protected]> on 02/03/98 12:19:52 PM
    Please respond to "Stokesbary, Michael" <[email protected]>
    To: "'[email protected]'" <[email protected]>
    cc:
    Subject: Problems with ListViews Drag and Drop
    I am just curious as to other people's experiences with the ListView
    widget when elements in it are set to be draggable. In particular, I am
    currently trying to design an interface that looks a lot like Windows
    Explorer where a TreeView resides on the left side of the window and a
    ListView resides on the right side. Upon double clicking on the
    ListView, if the current node that was clicked on was a folder, then the
    TreeView expands this folder and the contents are then displayed in the
    ListView, otherwise, it was a file and it is brought up in Microsoft
    Word. All this works great if I don't have the elements in the ListView
    widget set to be draggable. If they are set to be draggable, then I am
    finding that the DoubleClick event seems to get registered twice along
    with the ObjectDrop event. This is not good because if I double click
    and the current node is a folder, then it will expand this folder in the
    TreeView, display the contents in the ListView, grab the node that is
    now displayed where that node used to be displayed and run the events
    for that as well. What this means, is that if this is a file, then Word
    is just launched and no big deal. Unfortunately, if this happens to be
    another directory, then the previous directory is dropped into this
    current directory and a recursive copy gets performed, giving me one
    heck of a deep directory tree for that folder.
    Has anybody else seen this, or am I the only lucky one to experience.
    If need be, I do have this exported in a .pex file if anybody needs to
    look at it more closely.
    Thanks in advance.
    Michael Stokesbary
    Software Engineer
    GTE Government Systems Corporation
    tel: (650) 966-2975
    e-mail: [email protected]

    here is the required code....
    private static class TreeDragGestureListener implements DragGestureListener {
         public void dragGestureRecognized(DragGestureEvent dragGestureEvent) {
         // Can only drag leafs
         JTree tree = (JTree) dragGestureEvent.getComponent();
         TreePath path = tree.getSelectionPath();
         if (path == null) {
              // Nothing selected, nothing to drag
              System.out.println("Nothing selected - beep");
              tree.getToolkit().beep();
         } else {
              DefaultMutableTreeNode selection = (DefaultMutableTreeNode) path
                   .getLastPathComponent();
              if (selection.isLeaf()) {
              TransferableTreeNode node = new TransferableTreeNode(
                   selection);
              dragGestureEvent.startDrag(DragSource.DefaultCopyDrop,
                   node, new MyDragSourceListener());
              } else {
              System.out.println("Not a leaf - beep");
              tree.getToolkit().beep();
    }

  • Flash drag and drop not working on Firefox for android browser

    Drag and drop functionality is not working using Firefox Browser for Android on tablet. We tested with flash action script 2.0 & 3.0 content, both have same issue. Specs of the tab and OS are as follows.
    Android - Kitkat 4.4.2
    Tab models - Lenovo A7600H and Samsung Tab4 T531
    Please refer to a previous case raised on the same issue here at this link (Case 1029615) - https://support.mozilla.org/en-US/questions/1029615
    Additionally, we observed that the object on which Drag and Drop event was triggered, is moving little bit when we double tap.
    Does Firefox provide any libraries to support Drag and Drop functionality on Flash? We are using Geekoview api to execute flash content in our app. Will the same support be provided in Geekoview as well?
    Are there other folks facing the same issue? Is there a solution or workaround to get this feature running?

    Flash on Android is no longer supported by Adobe. While Firefox does support basic functionality we mainly focus on legacy video applications. You may run into issues with Flash and Geckoview. I doubt we have any resources to support that configuration.

  • Drag and Drop operation of SWT is not working in windows 7

    I have created VB script to elevate all administrator permissions to user and launched my application but not able to drop image to label in my application on Windows 7. It works fine if I remove User Account Setting (UAC). Please help how I can solve it.

    WTF? What are you talking about?
    Drag and drop of what from where to where does not work how?
    - What are you dragging?
    - From Where?
    - To Where?
    - What do you expect to happen?
    - What happens?
    - Why do you expect that to happen?
    - What technologies are you using?
    Basically, read [_How To Ask Questions The Smart Way_|http://www.catb.org/~esr/faqs/smart-questions.html].

Maybe you are looking for

  • Is this even possible? (Rotation question)

    Hi! I'm new to Java 3D... What I am trying to do is to rotate one transform group around another transform group. i.e. get a moon spinning the earth does anyone know how to do this? I am posting my code below.... I've searched the forums already and

  • Namespace and taglibs?

    I don't understand why I didn't get any errors from tomcat when I was missing the standard taglibs and using the jstl core in my jsp. Once I added the dependency for standard taglibs to my maven pom.xml then c:forEach started working; without the dep

  • Strange date/time in App. Builder

    I just noticed that the executable file that was created by using App. Builder always showed differenct date/time from the current date/time. Anyone could give me an idea what is wrong? How can I set it to the correct date/time? Thank you in advance

  • UUT serial number is not displayed in batch results popup window?

    UUt serial number is not displayed in batch results popup window. I am using TestStand 2012 SP1 f1 (5.0.1.66). I am also using Prebatch callback and setting up  Parameters.ModelData.TestSockets[index].UUT.SerialNumber with the UUT serial number. I ha

  • Macbook Air and Devolo Homeplug Conflict

    I am have a major conflict issue with my Macbook Air (2010)and a set of Devolo Homeplugs Once the both are on the same network (does not have to connect directly) then it brings down the entire network Cannot ping any device or router No other device