Results 1 to 6 of 6
  1. #1
    Delete command in Context Menu

    Member Since
    Jun 24, 2011
    Posts
    144
    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 12:59 PM. Reason: Grammar

  2. #2
    Delete command in Context Menu
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,075
    Specs:
    13in macbook - 10.10.4
    Add an i switch and remove the f switch in the rm command.
    rm -ir "$f"
    Makes it ask for confirmation.
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  3. #3
    Delete command in Context Menu

    Member Since
    Jun 24, 2011
    Posts
    144
    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
    Delete command in Context Menu
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,075
    Specs:
    13in macbook - 10.10.4
    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?
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  5. #5
    Delete command in Context Menu

    Member Since
    Jun 24, 2011
    Posts
    144
    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
    Delete command in Context Menu
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,075
    Specs:
    13in macbook - 10.10.4
    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.
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

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, 03:25 PM
  2. .mpg context menu
    By dnbreaks in forum OS X - Operating System
    Replies: 4
    Last Post: 06-04-2012, 11:58 AM
  3. Right Click Context Menu - How???
    By jeremybe in forum Switcher Hangout
    Replies: 2
    Last Post: 10-25-2007, 02:12 PM
  4. Word and context menu shortcut?
    By wrinkledpants in forum OS X - Apps and Games
    Replies: 0
    Last Post: 06-03-2007, 02:01 PM
  5. Context Menu
    By Kash in forum OS X - Operating System
    Replies: 7
    Last Post: 02-06-2007, 11:54 AM

Posting Permissions

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