Attach Files in Daylite via Applescript.

120 views
Skip to first unread message

byron white

unread,
Aug 2, 2016, 7:32:27 AM8/2/16
to F-Script
Hello, 

I'm new to F-script, but I have been using applescript for years. I'm trying to automate some procedures in Daylite.

One issue in particular, I can't seem to figure out:  I want to create a simple service using applescript so that I can right click on a file and select the service option (i.e. my applescript) to run, it will do the following:

Step 1) Create a new task in daylite; and 
Step 2) Link the selected file to the new task. (as a reference or as a copy to the server or both/either)


Step 1 is no problem:
————
tell application "Daylite"
eval "
newTask := objectContext createObjectForEntityNamed:'Task' insert:true.
newTask setTitle:'New Task with File Attached '.
end tell
————

Step 2, I cannot figure out the file reference part at all.

I see in the F-Script Browser there is a method when selecting a task called “createAndAddToFileAttachments” under which is another method called “setFileAttachmentAttributesFromFileURL”

which I think either one or both of these is what I need to use, but I can’t figure out what input format the method wants because it doesn’t accept “/“ or “\” in the URL reference.

Can anyone help ?


Adam Sneller

unread,
Nov 18, 2016, 11:36:13 AM11/18/16
to F-Script
Did you ever figure this out?

Christoph Schwerdtner

unread,
Jul 23, 2018, 6:12:21 AM7/23/18
to F-Script
did you ever try to use AppleScript path descriptions instead of POSIX? You might use Apple path descriptions where the folder delimiter is a colon
Reply all
Reply to author
Forward
0 new messages