Applescript has a funny thing with vars in scripts that aren't 'compiled' before being run.
Try changing the first line to this: (It'll mean that the 'theFile' value is always available) property theFile: "Path:To:File.txt" On 19 August 2013 04:04, Andrea Ghensi <[email protected]> wrote: > Hi all, I'm trying to write an applescript action for quicksilver that > lets me prepend a text into a text file (my journal, saved in the same > folder of my nvAlt notes). I also add the current date and time before the > text (or URL) of the first pane. I put up the script copying from various > sources, here you are: > > set theFile to "Path:To:File.txt" > > > on format_date() --it gives me the date in YYYY.mm.dd HH:MM format > set {year:y, month:m, day:d} to current date > tell ((y * 10000 + m * 100 + d) as string) & " " & time string of (current > date) to text 1 thru 4 & "." & text 5 thru 6 & "." & text 7 thru 14 > end format_date > > > using terms from application "Quicksilver" > on get direct types > return {"Apple URL pasteboard type", "NSStringPboardType"} > end get direct types > > on process text journalentry > try > set N to open for access theFile with write permission > get eof N > if result > 0 then > set theText to read N > else > set theText to "" > end if > set eof N to 0 > write "###" & format_date() & journalentry & return & return & theText > to N > close access N > end try > end process text > end using terms from > > It works outside of quicksilver (removing the quicksilver related lines > and setting the variable journalentry to some text), but I cannot make it > work with QS. > Do you have any idea why? or do you know how I can debug this thing? > Thanks for your attention! > Cheers from Italy > > -- > You received this message because you are subscribed to the Google Groups > "Quicksilver" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to > [email protected]. > Visit this group at http://groups.google.com/group/blacktree-quicksilver. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Quicksilver" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/blacktree-quicksilver. For more options, visit https://groups.google.com/groups/opt_out.
