Adjust this workflow for OneDrive

Discussion in 'Mac Basics and Help' started by Traverse, Apr 17, 2014.

  1. Traverse, Apr 17, 2014
    Last edited by a moderator: Apr 17, 2014

    Traverse macrumors 603

    Traverse

    Joined:
    Mar 11, 2013
    Location:
    Here
    #1
    Hi,

    Someone on Macrumors helped me write an automator workflow to for a control-click option to save to my dropbox folder, but also to remove certain metadata (so that I didn't have duplicate tagged documents, etc).

    I don't want to mess anything up, can someone edit this code for my OneDrive folder? Would you just interchange Dropbox for "OneDrive"?

    Thank you so much!


    Code:
    for FILE in "$@";do
    	FILE_NAME="${FILE##*/}"
    	if [ -d "$FILE" ]; then 
    		rsync -rut "$FILE"/ /tmp/"$FILE_NAME"
    		xattr -rc /tmp/"$FILE_NAME"
    		rsync -rut /tmp/"$FILE_NAME"/ ~/Dropbox/"$FILE_NAME"
    		rm -r /tmp/"$FILE_NAME"/
    	else
     		rsync -ut "$FILE" /tmp/"$FILE_NAME"
    		xattr -c /tmp/"$FILE_NAME"
    		rsync -ut /tmp/"$FILE_NAME" ~/Dropbox/"$FILE_NAME"
    		rm /tmp/"$FILE_NAME"
    	fi
    done
     
  2. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    If your OneDrive folder is also located in your home folder than yes.

    Example :

    You log into your mac with username traverse. ~/Dropbox/ really is just a short notation of /Users/traverse/Dropbox/
    If you look in Finder at your traverse home folder under Places and you see a Dropbox and a OneDrive folder then you could just interchange Dropbox for "OneDrive". If the OneDrive folder is at another location then you need to change the path in your script.
     
  3. Traverse thread starter macrumors 603

    Traverse

    Joined:
    Mar 11, 2013
    Location:
    Here
    #3
    Thank you. I tried subbing the folder names and it appears to work (I just wanted to consult the experts here :D). Both folders are located in my home folder along with Documents, etc..

    I didn't know that was a short notation though, thank you.
     

Share This Page