• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Permissions problems in Sierra
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Permissions problems in Sierra


  • Subject: Re: Permissions problems in Sierra
  • From: Brian Christmas <email@hidden>
  • Date: Thu, 22 Dec 2016 10:22:10 +1100

G’day Shane.

Once again, put your ‘I'm bloody smart’ cap on.

Worked brilliantly, with an alteration. I need to save attachments into it.

Thank you, thank you!!

Regards, and Merry Christmas to everyone, from someone who can actually legitimately call himself ‘Father Christmas’ (two kids, 6 grandies)

Brian Christmas

set pathToFile to (path to desktop as text) & "test" & ".rtfd"
-- create file
set theFile to pathToFile as «class furl»
set fileRef to open for access theFile with write permission
close access fileRef
tell application "TextEdit"
tell document 1
save in theFile 
end tell
end tell


On 22 Dec 2016, at 9:27 am, Shane Stanley <email@hidden> wrote:

It appears that TextEdit won't let you write to a file that doesn't already exist. A workaround is to create the file first:

set pathToFile to (path to desktop as text) & "test" & ".rtf"
-- create file
set theFile to pathToFile as «class furl»
set fileRef to open for access theFile with write permission
close access fileRef
tell application "TextEdit"
tell document 1
save in theFile
end tell
end tell


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>

Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
References: 
 >Re:Permissions problems in Sierra (From: Brian Christmas <email@hidden>)
 >Re: Permissions problems in Sierra (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Permissions problems in Sierra
  • Next by Date: Re: Permissions problems in Sierra
  • Previous by thread: Re: Permissions problems in Sierra
  • Next by thread: Cropping pdf in ACROBAT
  • Index(es):
    • Date
    • Thread