Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Traverse

macrumors 604
Original poster
Mar 11, 2013
7,688
4,400
Here
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
 
Last edited by a moderator:

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
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.
 

Traverse

macrumors 604
Original poster
Mar 11, 2013
7,688
4,400
Here
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.