I can't make AppleScript create a file with a custom name

I want to make application "TextEdit" create a file in Desktop folder. However it doesn't compile with a constant error message popping up. The script:


tell application "TextEdit"

make new document named "Personal letter" at desktop ¬

with properties {text:"Dear NAME_PLACEHOLDER,

You're invited to join us in the office on Monday for pizza"}

end tell


Tried to change "desktop" to the full reference (folder "Desktop" of folder user_name etc) - no difference.

tellaWhat am I doing wrong?

Mac OS X (10.7.5), MacBook Pro 15.4 mid-2012

Posted on Jan 5, 2017 1:43 PM

Reply
16 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I can't make AppleScript create a file with a custom name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.