Poking around in AppleScript shows that the new document’s path is After editing the file the first time I try to save the file I get the above error. tell application “TextEdit” activate make new document set theDate to current date set text of document 1 to theDate as text save document 1 in. TextEdit was running, but it was hidden (therefore all windows are hidden). This just means you hid TextEdit from view. Running your script.
|Published (Last):||6 January 2014|
|PDF File Size:||14.79 Mb|
|ePub File Size:||20.61 Mb|
|Price:||Free* [*Free Regsitration Required]|
To start the conversation again, simply ask a new question. I apologize for the length of this question.
I think there are several things going on here, and I would like to probe them all. Also, I’ve found by searching that people have asked and written about the two phrases shown after the image of the error message below, though I haven’t found anything recent. So I’m hoping this will attract search hits beyond people participating ss this community. The situation is also a bit complicated. I am aware of the applescript-users mailing list, and I’ll probably post a much briefer version of this, but I think there’s more here than just a direct AppleScript question.
Also, I can’t post images or formatted text there. I had an AppleScript that was working fine. Part of it opens a new document and sets it text in preparation for some further manipulation:. I ran the script over and over as I developed it, sometimes stopping it, sometimes halting with an error, sometimes running to the end successfully. I had the whole thing in a try statement after which I had. Suddenly I am getting strange errors. I can’t figure out the conditions — sometimes it has happened after the script adds more text, sometimes if I start with an empty and type at it,sometimes if the text ap;lescript there then the system tries to autosave it, and who knows what else.
It definitely does not happen when the document is created with the initial text, just when an attempt is made to modify it — sometimes the attempt succeeds but the file still can’t be close or saved.
I hate this Containers nonsense — if textefit go into one of those folders, most of the time you’ll see links back to your top-level folders and textesit evidence of anything useful, and sometimes I think they cache stuff you are trying to delete there.
In any case, it it is often an obstacle to understanding things. What am I doing wrong in that script fragment or possibly the stuff around it? When I make a new TextEdit file through it’s menu the document isn’t anywhere, certainly not where the script’s doc sometimes ends up.
I guess the answer is going to be something like “create the file with a specific path so you know where it is going”, but it still bothers me.
Posted on May 27, 3: May 27, 4: The problem arose when I added the name property where the script creates appldscript document, as opposed to leaving it untitled. I was wondering about the name anyway, because it should really end in. May 28, 7: May 29, 6: In response to Pierre L.
Simple Applescript: Create a .txt file
I replied too fast. It chokes on the save the same way it did without the save. May 29, 7: I had replied to the email before the previous post, but it didn’t go textecit. Anyway, I said thanks, and asked why the close and reopen?
May 29, 8: Specify the path property into the properties of the document without the name property, because the title of the document will be the name in the path. May 30, 8: Without the close and textrdit, it doesn’t seem possible to save the subsequent changes to the text.
User profile for user: Mac OS X Speciality level out of ten: AppleScript, new doc in TextEdit, serious error with permissions on doc I apologize for the appldscript of this question.
Part of it opens a new document and sets it text in preparation for some further manipulation: I had the whole thing in a try statement after which I had close doc without saving Suddenly I am getting strange errors.
Why “don’t own the file”? There are several issues and questions here: Why is this happening? Once this has happened to a document with a particular name I can’t use that name in the script ever again without the same thing happening, no matter what I do to the document, if anything. How do I get rid of the temporary document so I can use that name again. However, the script can close the document after it has gotten into this weird state by simply doing close doc without saving After editing the file the first time I try to save the file I get the above error message.
The second time it also shows “Locked” after the window title. After editing the file the system eventually tries to autosave it, at which point I see: Reply I have this question too I have this question too Me too Me too.
All replies Drop Down menu. Reply Helpful Thread reply – more options Link to this Post.
AppleScript, new doc in TextEdit, serious… – Apple Community
Don’t understand how yours works and mine doesn’t. Jacques Rioux Jacques Rioux. Ask a question Reset.