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):||28 September 2009|
|PDF File Size:||15.36 Mb|
|ePub File Size:||12.95 Mb|
|Price:||Free* [*Free Regsitration Required]|
It was just that you said, “TextEdit was running, but it was hidden therefore all windows are hidden. At one point I thought maybe that key was setting set theFile to outside of the tell application “TextEdit” block but that was applescriot an absolute.
Easily save TextEdit documents via AppleScript – Mac OS X Hints
Nano 7 – backgrounds Hints 1 new Hints in the last 24 hours Comments last 2 days No new comments Links last 2 weeks No recent new links. My original post contained an error.
That’s not exactly what I’m saying, but the Dock example you’ve used is one way it could be hidden. Posted on May 27, 3: What’s the proper way to save this TextEdit Doc as rtf on my desktop? But by far the biggest advantage of a good dedicated app is sync across several computers.
I wanted a script which can save the text file into today’s folder. The only way I can think of at present to achieve what you want in a practical way is to ensure that your script minimises all other windows except for the one it’s just opened. But what about the other windows? So, what is your preferred solution here?
AppleScript, new doc in TextEdit, serious error with permissions on doc I apologize for the length of this question. And when I am creating a text texteedit tomorrow it should applescripf save the file into tomorrows folder.
I thought an underlined font might be switch in, but apparently not. Provide one, and a text file will be created in whatever folder you are currently viewing and then opened in your default text editor probably Text Edit.
Simple Applescript: Create a .txt file
I haven’t tested the answer by Mockman, but it may also be a good solution. My minor addition to your code deals wth this fact, but of course there may be better ways to do what you want.
In Automator I have 2 action: I appreciate your answer. Ssave hint looks like it will solve my issue, but perhaps someone can confirm? The script stops without warning after opening the files.
Created this page in 0.
The first question to answer is why were the windows missing from your first screenshot not visible? The second time it also shows “Locked” after the window title. Why “don’t own the file”? 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. Email Required, but applesceipt shown.
This just means you hid TextEdit from view. That is not the case. I often dump ideas, questions, and answers in TextEdit files which I later use Spotlight to retrieve. Can someone help me. Latest Mountain Lion Hints This is my very first applescript. If I minimize all windows of all applications, these invisible windows still do not appear. On both my machines Tiger and JaguarTE ignores everything except the preference setting.
I’m sure that there are other methods to identify the windows. How it works is it takes the first paragraph a line followed by return of the document — typically the title in my writing — and uses this to name the text file note some texgedit like ‘: Basically, what I was trying to do with my answer was explain why your script resulted in the behaviour you were experiencing and why that was to be expected.