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

homeshire

macrumors regular
Original poster
I once used an applescript app called EmailDisk to back up data to my online gmail storage. I fell out of the habit of using it for a couple years. Lately I found myself thinking all that storage at google, and nothing to use it for!!!

So I rediscovered EmailDisk.app and began to implement it again. Unfortunately, I found that it no longer works as I remembered/expected. It does indeed email data to me -- from me... but it will delete itself at google based on my actions locally in mail.app. I remembered that it automatically went into my google storage archive properly labeled etc.

I want to be clear that the code I post here is not mine. The author supplied it online without license or restriction. He simply put it out there, and it worked for me. I show it here only so that others might look at it and improve it or point out why it is no longer working as i would like. Conversely, if there is anyone out there who has found or devised an elegant method of using all that google storage space for archival purposes, whatever the method might be, if he could share it with me.

the code:
Code:
property diskaccount : "email address"

on run
	if diskaccount does not contain "@" then
		set emailaddy to display dialog ¬
			"You must enter a valid email address where you want to send your files." default answer diskaccount
		if button returned of emailaddy is "OK" then ¬
			set diskaccount to text returned of emailaddy
		if diskaccount does not contain "@" then
			set y to display dialog ¬
				"You entered an invalid email address." buttons {"Fix", "Leave"}
			if button returned of y is "Fix" then changeemail()
			if button returned of y is "Leave" then
				display dialog "You must enter a valid email address before you can use EmailDisk." buttons {"Quit"}
				set validaddy to false
			end if
		end if
	end if
	
	if diskaccount contains "@" then set validaddy to true
	
	if validaddy is true then
		set quityesno to false
		repeat until quityesno is true
			set quityesno to false
			set whatdo to display dialog ¬
				"This programs allows you to drag and drop files to automatically send them to an email account for archival.  Click 'Change Email' to set the email address to which the files will be sent.  Files will be sent through OS X Mail application with a subject line containing the file name and 'EmailDisk'.  See your email help for info. on filtering EmailDisk emails." buttons {"Change Email", "Send File", "Quit"} default button 2
			if button returned of whatdo is "Change Email" then ¬
				changeemail()
			if button returned of whatdo is "Send File" then ¬
				archive(choose file with prompt "Select a file:")
			if button returned of whatdo is "Quit" then ¬
				set quityesno to true
			if button returned of whatdo is "Help" then ¬
				display dialog "help"
		end repeat
	end if
end run


on changeemail()
	set emailaddy to display dialog ¬
		"The current email address being used for EmailDisk is below.  Enter a new address to change it." default answer diskaccount
	if button returned of emailaddy is "OK" then ¬
		set diskaccount to text returned of emailaddy
	if diskaccount does not contain "@" then
		set y to display dialog ¬
			"You entered an invalid email address." buttons {"Fix", "Leave"}
		if button returned of y is "Fix" then changeemail()
		if button returned of y is "Leave" then
			display dialog "You must enter a valid email address before you can use EmailDisk." buttons {"Quit"}
			set validaddy to false
		end if
	end if
end changeemail

on open some_items
	
	if diskaccount does not contain "@" then
		set emailaddy to display dialog ¬
			"You must enter a valid email address where you want to send your files." default answer diskaccount
		if button returned of emailaddy is "OK" then ¬
			set diskaccount to text returned of emailaddy
		if diskaccount does not contain "@" then
			set y to display dialog ¬
				"You entered an invalid email address." buttons {"Fix", "Leave"}
			if button returned of y is "Fix" then changeemail()
			if button returned of y is "Leave" then
				display dialog "You must enter a valid email address before you can use EmailDisk." buttons {"Quit"}
				set validaddy to false
			end if
		end if
	end if
	
	if diskaccount contains "@" then set validaddy to true
	
	if validaddy is true then
		
		repeat with this_item in some_items
			
			try
				
				archive(this_item)
				
			end try
			
		end repeat
	end if
	
end open

to archive(this_item)
	tell application "Finder"
		set fileName to name of this_item
	end tell
	tell application "Mail"
		set theSubject to fileName & " - EmailDisk"
		set newMessage to make new outgoing message with properties ¬
			{subject:theSubject, visible:false}
		tell the newMessage
			make new to recipient at end of to recipients with properties ¬
				{address:diskaccount}
			
			tell content
				make new attachment with properties ¬
					{file name:this_item} at ¬
					before the first character
			end tell
		end tell
		send newMessage
		
	end tell
end archive
I want to reemphasize, this is not my code, and I do not take credit for it. I simply use it as was provided.

Any improvements or other suggestions would be appreciated.

of course, google could make the whole point moot by simply releasing the gdrive so many expect!!!

Thank you all
 
I've never heard of EmailDisk, and it seems like an extra step in an online backup process that is unnecessary. Why not use a dedicated online storage service?
 
I've never heard of EmailDisk, and it seems like an extra step in an online backup process that is unnecessary. Why not use a dedicated online storage service?

I guess the short answer is that google is offering nearly 8 gigs, and I have nothng to use it for. I just want to make good use of it.

as for being an extra step, it's a droplet in my dock. drag and drop and it's in my online archive. then i forget it.

with online services, I have to set it up and configure the whole thing. and I only get 2 gigs for free, or i pay a monthly bill.

perhaps a matter of opinion, but i'd like to think I'm no worse off with what I'm trying to accomplish.

My problem is simply that it's no longer working as it was.

thanks for responding
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.