Dear List, I would be very grateful for any help you could give me as I've been struggling with it for a few days.
I'm trying to create a new file in the given directory and then replace old data with new data should that be required. I will get that data from the clipboard as it originates in another app. The data will be text.
Kind regards, Greg.
Here is the script which does not work.
tell application "Finder" copy (the clipboard) to Clip_Board end tell
set Bookmaker_Folder to "home:Documents:ReferenceWorks Bookmaker:" --in the finished script I would set this_book to Clip_Board
set this_Book to "Once upon a time in Silicon Valley... Hello" set this_file to (((Bookmaker_Folder) as text) & "New Book") my write_to_file(this_Book, this_file, false) on write_to_file(this_data, target_file, append_data) try set the target_file to the this_file as text set the open_target_file to ¬ open for access file target_file with write permission if append_data is false then ¬ set eof of the open_target_file to 0 write this_data to the open_target_file starting at eof close access the open_target_file return true on error try close access file target_file end try return false end try end write_to_file
|