Results 1 to 6 of 6
  1. #1


    Member Since
    Jun 24, 2011
    Posts
    157
    Delete command in Context Menu
    I have a Run Shell Script workflow which adds a Delete command to the context menu.

    for f in "$@"
    do
    rm -rf "$f"
    done


    I can't remember where I came by it but I want to add an "are you sure" confirmation request to the script. Can anyone help please?
    Last edited by Gren; 05-19-2014 at 01:59 PM. Reason: Grammar

  2. #2

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,403
    Specs:
    13in macbook - 10.11 --- 21in. iMac 10.11 --- HP win 8
    Add an i switch and remove the f switch in the rm command.
    rm -ir "$f"
    Makes it ask for confirmation.
    Always listen to experts. They’ll tell you what can’t be done and why. Then do it!
    -Lazarus Long

  3. #3


    Member Since
    Jun 24, 2011
    Posts
    157
    Quote Originally Posted by cradom View Post
    Add an i switch and remove the f switch in the rm command.
    rm -ir "$f"
    Makes it ask for confirmation.
    Unfortunately that doesn't work, I get the "Trash" sound, the file remains undeleted and there's no confirmation request.

  4. #4

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,403
    Specs:
    13in macbook - 10.11 --- 21in. iMac 10.11 --- HP win 8
    Odd. I make a dir with 3 files in it and tried to delete it with rm -ir and got this: (see pic)

    It asked for each file in the dir.
    Must need Terminal instead of Automator. That is how you're running it right?
    Always listen to experts. They’ll tell you what can’t be done and why. Then do it!
    -Lazarus Long

  5. #5


    Member Since
    Jun 24, 2011
    Posts
    157
    Quote Originally Posted by cradom View Post
    Odd. I make a dir with 3 files in it and tried to delete it with rm -ir and got this: (see pic)

    It asked for each file in the dir.
    Must need Terminal instead of Automator. That is how you're running it right?
    Yes, I made an Automator workflow, Terminal's a mystery to me. I'll have another look tomorrow. It's bedtime here, I have an early yoga class tomorrow.

    Thanks anyway and goodnight

    Gren

  6. #6

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,403
    Specs:
    13in macbook - 10.11 --- 21in. iMac 10.11 --- HP win 8
    Looks like you need to make some kind of loop in Automator to ask permission to delete for each file. I cant help with that because I don't know/use Automator.
    Sorry.
    Always listen to experts. They’ll tell you what can’t be done and why. Then do it!
    -Lazarus Long

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Double entries in SL context menu
    By stefangs in forum OS X - Operating System
    Replies: 3
    Last Post: 10-29-2013, 04:25 PM
  2. .mpg context menu
    By dnbreaks in forum OS X - Operating System
    Replies: 4
    Last Post: 06-04-2012, 12:58 PM
  3. Right Click Context Menu - How???
    By jeremybe in forum Switcher Hangout
    Replies: 2
    Last Post: 10-25-2007, 03:12 PM
  4. Word and context menu shortcut?
    By wrinkledpants in forum OS X - Apps and Games
    Replies: 0
    Last Post: 06-03-2007, 03:01 PM
  5. Context Menu
    By Kash in forum OS X - Operating System
    Replies: 7
    Last Post: 02-06-2007, 12:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •