10 Replies Latest reply: Feb 2, 2013 5:17 PM by Frank Caggiano
jauche1 Level 1 Level 1 (0 points)

I have just discovered Automator (fairly new Mac user, got a new 2012 15.4" Macbook Pro 500GB i7 in October) and have been trying and trying to allow it to move files from one folder to another. I get stopped everytime, whether it's a new folder I just created or one that was created by a third party application, it never works; I always get a "'X' couldn't be moved because you don't have permission to access 'Y'" (X being the folder FROM which I'm moving and Y the folder TO which I'm moving the files). I've checked the permissions with Terminal after changing every conceivable associated folder's access (Read and Write) all to no avail. These are what I received from a Terminal line I found on another forum user's posts:

Last login: Sat Dec  1 12:57:14 on ttys000

Jacks-MacBook-Pro:~ owner$

Last login: Sat Jan 26 15:42:31 on console

Jacks-MacBook-Pro:~ owner$

1. Jacks-MacBook-Pro:~ owner$ /usr/bin/who am i; /bin/ls -leO@d

owner    ttys000  Jan 26 15:52

drwxrwxrwx+ 28 owner  staff  - 952 Jan 25 11:11 .

0: group:everyone deny delete

2. Jacks-MacBook-Pro:~ owner$ /usr/bin/who am i; /bin/ls -leO@d /Users/owner/Documents/Digital\ Editions

owner    ttys000  Jan 26 15:52

drwxrwxrwx  16 root  staff  - 544 Jan 26 00:00 /Users/owner/Documents/Digital Editions

3. Jacks-MacBook-Pro:~ owner$ /usr/bin/who am i; /bin/ls -leO@d /Users/owner/Documents/epub\ Books

owner    ttys000  Jan 26 15:52

drwxr-xr-x  2 owner  staff  - 68 Jan 25 23:07 /Users/owner/Documents/epub Books

 

1. is run without anything, 2. is the folder from a third party application and 3. is from a folder I created myself.

 

Any help would be appreciated, thank you!


MacBook Pro, Mac OS X (10.7.5)
  • 1. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    baltwo Level 9 Level 9 (60,115 points)

    You need to add with administrative privileges to your workflow scripts. See http://developer.apple.com/library/mac/#technotes/tn2065/_index.html for details.

  • 2. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    MrHoffman Level 6 Level 6 (12,455 points)

    I'd tend to change the permissions on the target folders to allow access directly or via access control list, rather than overriding system security with root.  The latter approach does certainly work, but those protections are also excellent "blade guards" against accidents and errors; if your script goes weird or the tool does something unexpected or somebody specifies the "wrong" target, you can end up (for instance) clobbering something in the operating system.  The former often solves the same problems, and it means you still have some protections (no pun intended) against the unexpected.

  • 3. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    baltwo Level 9 Level 9 (60,115 points)

    MrHoffman wrote:

     

    I'd tend to change the permissions on the target folders to allow access directly or via access control list, rather than overriding system security with root.  The latter approach does certainly work, but those protections are also excellent "blade guards" against accidents and errors; if your script goes weird or the tool does something unexpected or somebody specifies the "wrong" target, you can end up (for instance) clobbering something in the operating system.  The former often solves the same problems, and it means you still have some protections (no pun intended) against the unexpected.

    The OP said that wasn't working.

  • 4. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    MrHoffman Level 6 Level 6 (12,455 points)

    With no disrespect toward anyone in this thread, I doubt permissions (or ACLs) are not working as expected on OS X.  There's likely something (else) going on, whether it's another directory that's involved, or some other access that's occurring.  Try a small script that just does a copy, and see if that works.  Post a script that reproduces the error, and we can have a look at what that's doing.

  • 5. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    Frank Caggiano Level 7 Level 7 (23,830 points)

    This printout

    1. Jacks-MacBook-Pro:~ owner$ /usr/bin/who am i; /bin/ls -leO@d

    owner    ttys000  Jan 26 15:52

    drwxrwxrwx+ 28 owner  staff  - 952 Jan 25 11:11 .

    0: group:everyone deny delete

    is troubling. It appears as though you have chnage the permissions on your home folder. If so you could be causing major system problems.

     

    Also this:

    I've checked the permissions with Terminal after changing every conceivable associated folder's access (Read and Write) all to no avail.

    (emphasis added) is scary. OS X expects permissions on certain folders, the ones it creates especially, to have certain values. If you go about randomly changing things you will cause the system to malfunction.

  • 6. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    rccharles Level 5 Level 5 (5,370 points)

    I do not think it is a permisssions problem wit the folders shown. 

     

    Could be individula file permission problem. 

     

    Please post script.

     

    Why?

    2. Jacks-MacBook-Pro:~ owner$ /usr/bin/who am i; /bin/ls -leO@d /Users/owner/Documents/Digital\ Editions

    owner    ttys000  Jan 26 15:52

    drwxrwxrwx  16 root  staff  - 544 Jan 26 00:00 /Users/owner/Documents/Digital Editions

    Everyone has access!

     

    fyi: I do not know why the owner is set to root. odd.

     

    Normally, I'd say everything in /Users/owner should be owned by you.

     

    -----------------------------

    /bin/ls -leO@d

     

    why the /bin?

    ls -leO@d

    should work fine.  If not, something is odd.

  • 7. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    jauche1 Level 1 Level 1 (0 points)

    The associated files are simply folders storing .epub and audio files made by me. I have not touched any of the more important files because I've heard of the dangers associated with doing that. What scripts should I be running in this situation?

  • 8. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    jauche1 Level 1 Level 1 (0 points)

    Does this have anything to do with my current problem? I vaguely understand this, but still a little fuzzy.

     

    Warning: In Mac OS X 10.4.0 and 10.4.1, with administrator privileges executes the command with only the effective user id set to root. This causes trouble for some commands that rely on the real user id — for example, Perl will turn on its "taint mode" security checks, and sudo(8) will hang. To work around the problem (assuming you cannot simply remove a use of sudo; see above), preface your command with a small Perl script to set the real user id, like this:

    do shell script "/usr/bin/perl -Ue '$< = $>; system(@ARGV)' my_command" with administrator privileges

    Mac OS X 10.4.2 sets both the real and effective user ids; the workaround described here will be unnecessary, but harmless.

    Warning: Prior to Mac OS X 10.4, with administrator privileges did not work correctly with multiple commands. You had to turn your multiple commands into a single invocation of sh, like this:

    set normal_command to "command1; command2" do shell script "sh -c " & quoted form of normal_command with administrator privileges

    As of Mac OS X 10.4, you can use with administrator privileges with multiple commands as described in "how can I use more than one command" above; no workaround is necessary.

    How long can my command be? What’s the maximum number of characters?

    There is no precise answer to this question. (See Gory Details for the reasons why.) However, the approximate answer is that a single command can be up to about 262,000 characters long — technically, 262,000 bytes, assuming one byte per character. Non-ASCII characters will use at least two bytes per character — see Dealing with Text for more details.

    Note: This limit used to be smaller; in Mac OS X 10.2 it was about 65,000 bytes. The shell command sysctl kern.argmax will give you the current limit in bytes.

    Overrunning the limit will cause do shell script to return an error of type 255. Most people who hit the limit are trying to feed inline data to their command. Consider writing the data to a file and reading it from there instead.

  • 9. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    jauche1 Level 1 Level 1 (0 points)

    CASE CLOSED

     

    I recently updated to Mountain Lion and now Automator works like a charm. I have permissions and everything is hunky dory. Thank you all so much for your help.

  • 10. Re: How do I allow my admin account to have unlimited permission and allow Automator to move Finder Files?
    Frank Caggiano Level 7 Level 7 (23,830 points)

    On a stock OS X machine a user can move files between folders in their home folder without any issues as long as nothing has been done to the standard permissions.

     

    You need to show the scripts or automator workflows that you are using. You also need to describe what has been done to the permissions, what you show in your first post makes no sense especially the settings on your home folder.

     

    I'm not sure what baltwo was aiming at in his post and that link but again you should be able to move files around without setting any special admin permissions.

     

    regards