|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
Can anyone give me a tip about how to add a file reference to a contact with F-Script? I would like to do the same as the contextual menu item "Add File Reference", but I need to do it from a script.
All I've managed so far is the following: tell application "Daylite" eval " document := (NSApplication sharedApplication) firstDayliteDocument. objects := (document firstMainWindowController) selectedObjects. object := objects lastObject. urlReference := ((GWURLReference alloc) init). urlReference setTypeCode:1; setUrl:'http://www.vimia.com'; setName:'Vimia GmbH'; setNote:'Test'. (object urlReferences) add:urlReference. " end tell This creates the GWURLReference and appends it to (object urlReferences), but urlReference is not initialised. Steve |
||
|
|
Apprentice |
I've solved it. For those who are interested, this is how I did it:
tell application "Daylite" eval " document := (NSApplication sharedApplication) firstDayliteDocument. objects := (document firstMainWindowController) selectedObjects. object := objects lastObject. objectContext := object objectContext. cc := objectContext creationContext. urlReference := cc createObjectForEntityNamed:'URLReference' addToObjectContext:true. urlReference setTypeCode:1; setUrl:'http://www.vimia.com'; setName:'Vimia GmbH'; setNote:'Test'. object addToUrlReferences:urlReference. objectContext saveChanges. " end tell I'm going to use this to create an Automator action and/or a system service to copy URLs into Daylite as URLReferences. Steve |
|||
|
|
Apprentice |
whoah, that looks impressive (not that I know how scripting works), but will this have the effect of allowing external applications to include a macro-type function to enable file paths/references to DL contacts/orgs, etc.?
|
|||
|
|
Apprentice |
Tim
It works the other way around. It allows me to attach URLs and filenames to objects in Daylite. I use it to create links to e-mails in Xing (which is browser-based), but it works with any kind of URL. I don't know if it is possible to export links from Daylite which would be accessible from external programs, which I think is what you are looking for. Perhaps the daylite: or daylite3: protocols allow this: I haven't had time to look at them closely enough. I agree that it would be useful. Steve |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

