MobileMe is no longer available but this script could be modified to save in other online storage facilities.
Whilst Apple now allow you to send a link to a file to another user it requires the use of a web interface, I’m sure it will eventually be built into the Finder but until then this script helps to automate the process.
The first part of the script asks you to select a file, the next part uses a shell script to compresses it to a zip file if it is not already zipped. It then gets the mobileme name and then copies the zipped file to the Public folder of your MobileMe (.dot mac) account. The final part of the script creates the email that you need to send to the intended recipient.
The Script Menu can be added as a Menu Extra to allow easy access to many AppleScript scripts from the menu bar (Mac OS X ships with several scripts that are ready to use to accomplish some common tasks). You can also add your own scripts to this menu. To enable the Script Menu, run AppleScript Utility (located at /Applications/AppleScript/AppleScript Utility) and check the “Show Script Menu in menu bar” checkbox.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
property mobileme_name : "" property zip_file : "false" property file_name : "" property mobileme : "" set theFile to (choose file with prompt "Select the file:") as text try set text item delimiters to ":" set file_name to last text item of theFile set text item delimiters to "" on error set text item delimiters to "" end try if theFile ends with "zip" then set zip_file to "true" end if if zip_file is "true" then --no need to compress set posix_path_theFile_zip to POSIX path of (theFile as text) else if zip_file is "false" then --compress file first set posix_path_theFile to POSIX path of (theFile as text) set posix_path_theFile_zip to posix_path_theFile & ".zip" set file_name to file_name & ".zip" do shell script "zip -r -j " & posix_path_theFile_zip & " " & posix_path_theFile & "" end if tell application "Mail" --this assumes you have an mobileme email account --if you don't you will need to set the property at the start of the script try set mobileme_name to name of every Mac account end try end tell set destination_posix to "/Volumes/" & mobileme_name & "/Public" set destination_web to "http://idisk.mac.com/" & mobileme_name & "-Public/" & file_name do shell script "cp " & posix_path_theFile_zip & " " & destination_posix set zip_file to "false" tell application "Mail" make new outgoing message with properties {visible:true, subject:"Link to File", content:"The file is here: " & destination_web} end tell |
Last updated 6 March 2023