Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 9, 2013, 08:06 AM   #1
DKnow75
macrumors newbie
 
Join Date: Jun 2013
Action Folder in /Volumes/

Hi folks,

I'm trying to implement the "Automating Backup of Flash Drives" on my Mac Mini i5 with Mac OS X 10.7.5. But, when I run it, it gives an error like "Can't get every file".

If I understood it well, the code should create a list of every item on the folder /Volumes/ in order to test later if some of these items has a file rsync.scpt to execute the backup.

I simplified the code to test just this part with some variations but I didn't succeed.

Code:
on adding folder items to this_folder after receiving these_volumes
	tell application "Finder"
		try
			set the volume_list to every file of this_folder as list
			display dialog volume_list as text
			display dialog number of items in volume_list as text
			display dialog this_folder as text
			
			set the volume_list to every folder of this_folder
			display dialog volume_list as text
			display dialog number of items in volume_list as text
			display dialog this_folder as text

			set this_item to the original item of item 1 of volume_list
			display dialog this_item as text
			set this_item to the original item of item 2 of volume_list
			display dialog this_item as text
			
		end try
	end tell
end adding folder items to
Do you have any suggestion to make this part of the code to work properly?
DKnow75 is offline   0 Reply With Quote
Old Jun 9, 2013, 02:09 PM   #2
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Why not use the script from the link? What do you mean with when I run it?
It is not meant to be run manually but to be attached to a folder.
If you attached this folder action script to the /Volumes folder it gets triggered when items are added to the /Volumes folder like when plugging in a Flash drive. Please post the entire error message.
__________________
Space Corps Directive 34124
kryten2 is offline   0 Reply With Quote
Old Jun 9, 2013, 03:02 PM   #3
DKnow75
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Quote:
Originally Posted by kryten2 View Post
Why not use the script from the link? What do you mean with when I run it?
I used the script from the link and I followed the instructions to use it (that's what I mean by 'run it'). I set the action script for the folder Volumes to execute the auto_backup script as mentioned on the link. But when I added an USB stick it did nothing. It didn't copy the USB stick's content to my HD as I specified on rsync.scpt. It didn't show any error message also.

As the rsync.app is working properly (I test it on my USB stick), I started to debug the auto_backup script to see what happened. At the debugging the script shown the message 'Can't get every file' for the variable 'volume_list' on the line:
Code:
set the volume_list to every file of this_folder
That's why I tried to simplify the script to test this line and other variations for it to see if it works.
DKnow75 is offline   0 Reply With Quote
Old Jun 9, 2013, 03:29 PM   #4
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
Describe your debugging process or better post a screenshot of it.
__________________
Space Corps Directive 34124
kryten2 is offline   0 Reply With Quote
Old Jun 12, 2013, 04:08 PM   #5
DKnow75
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Here there is an image of the debugging process for the auto_backup.scpt...



Uploaded with ImageShack.us
DKnow75 is offline   0 Reply With Quote
Old Jun 15, 2013, 07:12 AM   #6
DKnow75
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Thats intrigues me...
DKnow75 is offline   0 Reply With Quote

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Automator folder action not working NYR99 OS X 0 Mar 11, 2014 01:48 AM
Triggering folder action on dropbox folder? ronswanson Mac Programming 3 Aug 7, 2013 03:39 PM
Folder Action to spotlight and copy tedesco24 Mac Programming 11 Feb 22, 2013 09:07 AM
Looking for a folder action for PDFs and NValt ... eroxx Mac Applications and Mac App Store 0 Jul 23, 2012 07:21 PM

Forum Jump

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

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

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