[OMC] Re: (FileOrFolder: Put in folder) PROBLEM

OMC at abracode.com OMC at abracode.com
Wed Oct 12 15:34:26 EDT 2005


I understand that the command discussed here is "Put in folder" (#396 in
archive).
Well, there are 2 things that should be done to improve this command.
First, the command should not be activated when user right-clicks on Desktop
or within open Finder window. The ACTIVATION_MODE should be changed from
act_file_or_folder to act_file_or_folder_not_finder_window.
Second, the command always deletes the original file/folder even if the copy
operation failed. This should be fixed by replacing ";" (unconditional
execution of next command) with "&&" (executes only if previous command
succeeded) so it looks like:
cp -R __OBJ_PATH__ __DLG_CHOOSE_FOLDER_PATH__ && rm -R __OBJ_PATH__

Hope it helps,
Tom
Abracode

On 10/12/05 10:37 AM, "OMC at abracode.com" <OMC at abracode.com> wrote:

> Thank you Doug. I'm sorry this happened to you.  Fixing that problem is
> beyond my capacity, and I believe that could impact other commands as well.
> so I'm forwarding it to the discussion list.
> 
> 
> On 10/11/05 6:54 PM, "Doug Judson" <djudson at mechanix.com> wrote:
> 
>> Your command has a really bad problem.  I downloaded your command for
>> OMCEdit because it seems really useful.  But, it has a bad side.  Although
>> you tell it to only activate on "Files or Folders", clicking on the destop
>> considers itself to be a folder.  AKA the "Desktop" folder.  I had no idea
>> what file it was asking to move so I continued to select a folder on the
>> desktop to move the "unknown folder" to.  BAM. The entire contents of the
>> Desktop folder are removed fro the hard drive.
>>     In looking into what actions you guys used to make this happen, I
>> discovered a flaw.  When you use the terminal command "cp -R __OBJ_PATH__
>> __DLG_CHOOSE_FOLDER_PATH__" the terminal will try to put the contents of the
>> "Desktop" folder into the folder that resides on the desktop, resulting in
>> an endless loop.  The terminal then returns "File name too long. No file was
>> copied." The problem is that, when you combine "cp -R __OBJ_PATH__
>> __DLG_CHOOSE_FOLDER_PATH__" and "rm -R __OBJ_PATH__", then terminal will
>> return the endless loop with the statement above and go ahead and remove the
>> desktop folder completely.
>>     I just wanted to let you know of this.
>> 
>> 
> 
> 
> 
> _______________________________________________
> OMC mailing list
> OMC at abracode.com
> http://abracode.com/mailman/listinfo/omc_abracode.com
> 
> 






More information about the OMC mailing list