G’day scripters.
My situation.
1. I’m processing incoming email for attached images
2. If attachments, saving the email to desktop as .rtfd
3. No attachments save in 2 because of a bug, so I’m opening the mail item, selecting All, and copying to clipboard.
4. Using TextEdit, opening the .rtfd and pasting in from the clipboard.
5. Processing the attachments (printing), and saving them in 3 redundant backups, as email (2), and rtfd (3).
Problem.
If an email has an embedded html image, which saves in the .rtfd, the ‘tell application “TextEdit” to 'open file X’ freezes with a displayed error message, without focus, permanently, and is untrappable, and can only be dismissed by activating the error message, so freezing my App. Focus is removed from TextEdit while the error message displays.
If I manually add an ‘Administrator’ read/write privilege, textEdit will open the file, but doing so requires an Admin password in the first place.
Can anyone suggest a method of overcoming this dilemma, please?
Also, should I report this as a bug?
Regards
Santa
tell application "Finder" # # Set the saved rtf file path # set theDesktoprtfdFile to file ((path to desktop) & "2015-01-29 192736Z.rtfd" as text) # try set owner privileges of theDesktoprtfdFile to read write end try try set group privileges of theDesktoprtfdFile to read write end try try set everyones privileges of theDesktoprtfdFile to read write end try end tell tell application "TextEdit" try activate open theDesktoprtfdFile as alias # Freezes activate if not (exists document 1) then # code end if end try end tell say "finished"
|