Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 26, 2012, 04:35 AM   #1
Polansky
macrumors newbie
 
Join Date: Nov 2010
Applescript rsync and property

I have written the following script which will copy one of the folders on my desktop to my NAS via rsync. The script works fine.

However I want the rsync command to refer to the property in the script.

The working script:

--
Code:
property User : {"Macusername"} -- The Username you use on your Mac
property SourceHD : {"Macintosh HD"} -- The name of your Mac Computer (HDD)
property SourceFolder : {"Desktop", "Thetered"} -- Your sourcefolder(s)

property NASuser : {"mynasusername"} -- The Username on your NAS
property NASpassword : {"mynas password"} -- The Password of your NAS
property NASVolume : {"media"} -- NAS Shared Folder name
property NASDropFolder : {"photography", "Photostream"} -- The destination folder(s) on you NAS

-- Actual Script --

Code:
tell application "Finder"
		set sourcefiles to item 1 of SourceHD & ":Users:" & item 1 of User & ":" & item 1 of SourceFolder & ":" & item 2 of SourceFolder as alias
		try
			set target_folder_1 to item 1 of NASVolume & ":" & item 2 of NASDropFolder as alias
			set mounted_Disks to list disks
			if mounted_Disks contains item 1 of NASVolume then
				
				set thePath to quoted form of ("/Volumes/photography/Photostream/" & thetered)
				do shell script "rsync -aE ~/Desktop/Thetered/ " & thePath
				
			end if
		end try
	end tell
--



I want these to lines to refer to the property values in the script:


set thePath to quoted form of ("/Volumes/photography/Photostream/" & thetered)
and
do shell script "rsync -aE ~/Desktop/Thetered/ " & thePath

Could somebody please help me because I am a littlebit stuck getting this to work via the property values.

Last edited by OllyW; Dec 26, 2012 at 01:43 PM. Reason: Please use code tags
Polansky is offline   0 Reply With Quote
Old Jan 14, 2013, 08:54 AM   #2
superscape
macrumors regular
 
Join Date: Feb 2008
Location: Yorkshire, UK
Hi

I'm not entirely sure I understand the question, but is it not just:

Code:
	set thePath to quoted form of ("/Volumes/photography/Photostream/" & item 2 of SourceFolder)
	do shell script " echo rsync -aE ~/Desktop/" & item 2 of SourceFolder & "/ " & thePath
Any good?
superscape is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
applescript, rsync

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Programming 0 Oct 29, 2013 12:38 AM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Applications and Mac App Store 0 Oct 29, 2013 12:32 AM
rsync basics Kilamite Mac Applications and Mac App Store 1 Apr 21, 2013 11:17 AM
Backing up using rsync Dan A Mac Programming 4 Dec 10, 2012 01:30 AM

Forum Jump

All times are GMT -5. The time now is 08:12 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC