April 6, 2019 posted by

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.

Author: Akinolkree Tojall
Country: Suriname
Language: English (Spanish)
Genre: Marketing
Published (Last): 20 May 2014
Pages: 321
PDF File Size: 4.82 Mb
ePub File Size: 2.67 Mb
ISBN: 266-7-50714-232-7
Downloads: 82241
Price: Free* [*Free Regsitration Required]
Uploader: Kigarisar

As you can see, I’ve just added two lines of code. I had the whole thing in a try statement after which I had.

MacScripter / What’s the proper way to save this TextEdit Doc as rtf on my desktop?

For example, you could achieve this with the following code:. Regarding the first script… yes. In response to Pierre L. Could be that you can’t without applescript, that is. 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 appoescript the first time I try to save the file I get the above error message.

I did that once. Here is the script: The warning that the desktop is locked now makes sense, though. I have the following AppleScript code that opens a specific file in TextEdit in a window with predetermined bounds: Sign up or log in Sign up using Google. Mac OS X Speciality level out of ten: I apologize for the length of this question.

Related Posts (10)  ASSEMBLEUR 8051 PDF

Simple Applescript: Create a .txt file

I can’t get either of these solutions to work correctly. Optionally create a folder named “Notes” — mine is inside my Documents folder. The first question to answer is why were the windows missing from your first screenshot not visible? So, while it’s not what you want to hear, your script is actually working the way it’s supposed to in macOS.

Anyway, I said thanks, and asked why the close and reopen? Will this script save all the TextEdit files created under the Artist – Track Title format that appears in the title bar of the window?

Atom topic feed Powered by FluxBB. I still consider it a bit of a bug that TE’s warning buttons don’t work — no textedif what you select, Overwrite or Don’t Overwrite it overwrites!

In your scenario, it’s almost certain that Option 2 applies. This is what my screen currently looks like after the AppleScript is triggered:. 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 sits there then the system tries to aplescript it, and who knows what else. The code will not bring twxtedit minimized TextEdit window to the front, but it will bring all hidden, non-minimized, TextEdit windows to the front.

One of my attempts reported in bugs actually erased my desktop folder. I thought so too, but using a note-keeping app helps to keep all these in one place, so you don’t have to worry about where to look. But what about the other windows? I find it a handy little app in its own right, but its AppleScript implementation certainly leaves a lot to be desired!

Related Posts (10)  GANGBUSTERS TSR PDF

Easily save TextEdit documents via AppleScript – Mac OS X Hints

So I’m hoping this will attract search hits beyond people participating in this community. Post as a guest Name.

I then want to save them all, but they need to be “Saved as”, which takes time a lot of it! This would be obvious – so no more discussion needed. I had replied to the email before the previous post, but it didn’t go through. I appreciate your answer.

Drag this folder to the sidebar of the Finder. This just means TextEdit is running but no windows are visible because they’ve been miminimed. OS X El Capitan, version Home Questions Tags Users Unanswered.

I found this very useful. Let me try to explain I pasted the script into script editor and saved as application. I just want to export all the files in the specified folders to pdf using TextEdit. Running your script simply makes it visible again along with all its windows except for any that may be minimised.

But it is really invisible. I was actually playing with the formatting and “discovered” this problem serendipitously. Hopefully this works for you – but if not maybe someone else comes up with a better solution.