Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

One way to attach files to iCal events Apps
Here is a way to attach files to ToDo items and Events in iCal. It works, it's handy, but it's kind of a pain in the neck to use. When you create an event or to-do, put a URL in the URL field that points to the local file you want to attach. The url has to be in this format:
file:///Users/nero/Desktop/map%20to%20Joe's.pdf
When you click on the bold "URL" label, you will get a menu that says "Go to Location." Click on that, and the file will open. This is very handy for lots of reasons.

The lame part is that this is all text based. You can't drag the file to the URL field, which is weird since drag-and-drop works in so many other places in Mac OS X. You have to type the thing in, including the %20's for every space and the file:// protocol part. But if you really want to attach files to iCal events, this is one way to do it. Any suggestions for making this a little easier? Quick ways to get the URL of a file?
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[13,388 views]  

One way to attach files to iCal events | 23 comments | Create New Account
Click here to return to the 'One way to attach files to iCal events' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One way to attach files to iCal events
Authored by: skinnyjimmy on Jul 08, '04 10:29:36AM

One quick way:

drag the file to a browser window (i.e. Safari), and copy the url from the address bar of that window!

James



[ Reply to This | # ]
One way to attach files to iCal events
Authored by: skinnyjimmy on Jul 08, '04 10:37:52AM

although this only works for 'readable' documents - i.e. text / pdf / images - not things like disk images or applications...

james



[ Reply to This | # ]
Easy way to get URL
Authored by: jolinwarren on Jul 08, '04 11:26:57AM
Probably the easiest way to quickly get the file URL is to download FileUtilsCM. One of its many useful features it the ability to copy a file's URL. What's best is you can set which features you want to appear in the contextual menu, so it doesn't get crowded with things you never use.



[
Reply to This | # ]
The URL
Authored by: jolinwarren on Jul 08, '04 11:28:43AM

I don't know what happened because the URL looked fine in the preview. But here it is:

http://free.abracode.com/cmworkshop/



[ Reply to This | # ]
OnMyCommand
Authored by: jecwobble on Jul 08, '04 11:47:01AM

I use OnMyCommand from Abracode which could be used, too, I suppose. Perhaps something like this seudo code:

echo "file://" + {objectpath} | tr " " "%20" | pbcopy

I may try this when I get a chance and post real code at that time.



[ Reply to This | # ]
OnMyCommand
Authored by: markju on Jul 08, '04 12:47:32PM
tr won't do what you want it to, you'll have to use sed:
echo "file://" + {objectpath} | sed -e 's/ /%20/g' | pbcopy
(with a space between the '/')

[ Reply to This | # ]
The Finder does this
Authored by: Krioni on Jul 08, '04 05:57:40PM
The Finder can get the file: protocol URL of any object. Here's the AppleScript code to do it:

tell application "Finder" to get URL of ( item 1 of ( get selection ))
So, to do this from the command-line, you'd use:

osascript -e 'tell application "Finder" to get URL of ( item 1 of ( get selection ))'
You get the idea. Now, if you wanted to make a droplet AppleScript, you'd need to put this code into it:

on open someFiles
	tell application "Finder" to get URL of (item 1 of (someFiles))
end open
Now, this only handles one item. You could rework it to give a return-delimited list of file URLs for multiple items, but iCal only wants one item, right? The good thing about using the Finder is that it should do all the character-conversion for you. I think. :-)

[ Reply to This | # ]
The Finder does this
Authored by: Simon Andersen on Jul 09, '04 06:54:22AM
If I may just make a small addition. It'd be really handy to have the Finder put the URL in the clipboard for easy pasting into iCal. So here we go:

on open someFiles
tell application "Finder" to set the clipboard to (get URL of (item 1 of (someFiles)) as string)
end open

Save this as an application in Script Editor and put it in to Dock for easy drag-and-drop

[ Reply to This | # ]
Easy way to get URL
Authored by: neroshaw on Jul 09, '04 11:40:46AM

THanks for the ideas. I'll have to try out OnMyCommandCM.

Or if not I could just put that URL-to-Clipboard Applescript in the Applescript Menu (I'm assuming, let me know if that wouldn't work).

I just know that by the time I get around to setting this up, the very next day, Apple will release a 0.0.1 update to iCal that adds drag-and-drop for files.

-ns



[ Reply to This | # ]
One way to attach files to iCal events
Authored by: DavidRavenMoon on Jul 08, '04 04:29:55PM

There is an easy way to open any file in iCal... Don't use the URL field, use the Alarm field.

Just click on the Alarm pull down and choose "Open File..."

Then pick the file of your choosing.



[ Reply to This | # ]
File2iCalEvent.scpt
Authored by: Anonymous on Jul 09, '04 08:24:03AM
I have a Applescript that will make this a little bit easier.

http://xdeb.org/wiki/AppleScript/File2iCalEvent

[ Reply to This | # ]
Why wont it work in 10.2.8
Authored by: alexmathew on Jul 09, '04 02:10:30PM

What is so special in this script that it wont work in 10.2?
Thanks
AM



[ Reply to This | # ]
Why wont it work in 10.2.8
Authored by: Anonymous on Jul 15, '04 03:38:34AM

I think you need the iCal version that come with 10.3.x, it has the needed AppleScript support.

Please test and see if it works with 10.2.x.



[ Reply to This | # ]
This tip is using the wrong method to launch a file...
Authored by: DavidRavenMoon on Jul 09, '04 09:45:37AM

Why are all you people going though such labor to write scripts and such when this feature is built into iCal???

The whole issue here is the original poster was doing it the wrong way... trying to use the URL field instead of the Alarm field. This is a case of not knowing how to use the software!

iCal already has the ability to launch a file without having to type a single line of anything. This is just reinventing the wheel! Just use the Alarm pulldown and choose your file.



[ Reply to This | # ]
This tip is using the wrong method to launch a file...
Authored by: dubmaster on Jul 09, '04 09:58:45AM

The tip is not about opening a file, but to attach a file to an event which are 2 totally different things when using a Task List or Agenda, and except for the URL Field I don't see how I can attach a File, so neroshaws tip is actually pretty helpful.

---
DubMaster
--
Rehab is for quitters!



[ Reply to This | # ]
This tip is using the wrong method to launch a file...
Authored by: DavidRavenMoon on Jul 09, '04 12:38:54PM

If you have a To Do list, for example, just pick an item in the list, open the info pane and click on the "due date." Then an "alarm" item appears. From that choose "Open file..." and pick the file you want launched at that date and time.

You can use the alarm feature to open any file in any event.

.



[ Reply to This | # ]
This tip is using the wrong method to launch a file...
Authored by: osxpounder on Jul 09, '04 01:36:30PM

OK, now I'm confused. What does "attaching a file" do for you? Can you be more specific about the *behavior* that will result from using this tip?

For example, if iCal isn't going to open the file, then what will happen instead? Is it going to send you email with an attachment? Is this just so that we can put a link, in the iCal appointment, to a file? I'm guessing it's the latter, but I am no longer sure.

---
--
osxpounder



[ Reply to This | # ]
Ok.. this is how it would help..
Authored by: alexmathew on Jul 09, '04 01:59:00PM

Lets say you have a meeting at 1.00pm and you have a PDF/TXT file that has all the information for the meeting. You need to review the file at odd times to work on it further or just to look at it.

By this hint, you can link to the file and pull it up WHEN YOU NEED IT - not dictated by an ALARM - which you have to pre-determine to setup.

Got it ??
Its not the same as attaching a file to an ALARM.
AM



[ Reply to This | # ]
Ok.. this is how it would help..
Authored by: DavidRavenMoon on Jul 09, '04 04:30:12PM

So just leave yourself a note to say "read file 'so-and-so'"

I really doubt that the person who posted this hint just wanted to know where the file was. For all the work involved to have a link to the file, it's just silly... it's probably quicker to just look on your desktop, or where ever.

Also if it's important to review a file before a meeting, having the PDF file launch would be just as helpful. I leave myself notes like this all the time (using the alarm feature).



[ Reply to This | # ]
Silly or not...
Authored by: alexmathew on Jul 12, '04 04:07:47PM

its useful for some people.
I cant believe you call hunting for a particular file/folder in your hard drive before a meeting a "simpler" solution when compared to having a direct link to the file/folder in your iCal.
When your scheduling meetings - its usually useful to have all the relevant facts in your event rather than have it pop-up during an alarm.

Again, "silly" or not ... this is a useful hint. I wish Apple wouold implement a direct method to do this.
AM



[ Reply to This | # ]
Silly or not...
Authored by: DavidRavenMoon on Jul 13, '04 02:09:41PM

I never "hunt" for files. I keep things well organized and always know where they are. :)



[ Reply to This | # ]
Silly or not...
Authored by: agniagni on Sep 11, '05 01:01:26PM

I don't understand what the problem is with somebody wanting this feature. As an editor, every single event on my calendar relates to a file. I have files coming in that other people edit for me with the same or slightly different names, and since Mac offers the nice option to copy and paste files directly from a location like the desktop into mail, why not add the option to copy and paste files from, say, an email to the "note" space in the iCal event and from that note space back to another email, say, three days later, when my client needs the document that my editor sent back to me earlier in the week. All kinds of calendar applications have this feature. It's advantages are obvious. For example, why should I search through my email for a file that's been sent back to me with Apple's imperfect attachment search function which inevitably returns a bunch of emails I don't want. It's nice that people keep their files organized. So do I. However, anything that Apple can do to reduce repetitive (i.e., redundant) taks, should be done.



[ Reply to This | # ]
Ok.. this is how it would help..
Authored by: osxpounder on Jul 13, '04 06:01:20PM

alexmatthew: thanks for the explanation; now I understand. This is a way to put the "url" field of an appointment to work for me as a link to any kind of file, whether it's on the web or on my HD. Correct me if I'm wrong.

---
--
osxpounder



[ Reply to This | # ]