Removing the ’Tell application “Finder” from my posted script seems to work, but when embedded into the project, fails with a ‘You don’t have permissions’ error.
.
if my serverBackupState and my attachmentCounter = 0 then
try
tell application "Finder" to set my dailyServerFolder to (my serverFolder & ":" & ("Yearly Email Storage " & my theYear as text) & ":" & (my theAddedMonth) & ":" & (my dailyName) as text)
on error errmsg number errnum
if my runForOz then tell application "System Events" to display dialog "Mail Manager Loop Runner setupPrintCoverPage setting dailyServerFolder folder " & errmsg & " error number " & errnum & " p = " & p
end try
set p to 10
try
do shell script "mkdir -p " & quoted form of POSIX path of (my dailyServerFolder as text)
on error errmsg number errnum
if my runForOz then tell application "System Events" to display dialog "Mail Manager Loop Runner setupPrintCoverPage setting server folder " & errmsg & " error number " & errnum & " p = " & p & return & (my dailyServerFolder as text)
end try
try
do shell script "mkdir -p " & quoted form of POSIX path of ((my dailyServerFolder) & ":" & (my fileDateTimeName) as text)
on error errmsg number errnum
if my runForOz then tell application "System Events" to display dialog "Mail Manager Loop Runner setupPrintCoverPage setting timed server folder " & errmsg & " error number " & errnum & " p = " & p & return & ((my dailyServerFolder) & ":" & (my fileDateTimeName) as text)
end try
try
set temp to ((my fileDateTimeName) & " Cover Sheet" as text)
set tempTwo to a reference to file (my dailyServerFolder & ":" & temp as text)
save document 1 in tempTwo
on error errmsg number errnum
if my runForOz then tell application "System Events" to display dialog "Mail Manager Loop Runner setupPrintCoverPage saving document " & errmsg & " error number " & errnum & " p = " & p & return & ((my dailyServerFolder) & ":" & (my fileDateTimeName) as text)
end try
end if
G’day scripters
I’ve tried lots of permutations, but cannot work out how to save an rtfd TextEdit document to a remote disk.
I usually get a message the I don’t have permissions, but I’ve set the permissions on both disk and containing folder to all three permissions as ‘read/write’.
My latest effort is…
property dailyServerFolder : "Jobs:Yearly Email Storage 2015:09:2015 09 24:2015-09-24 015737"
property fileDateTimeName : "(20150924 121212Z).rtfd"
tell application "TextEdit"
activate
delay 1
set temp to name of window 1
tell application "Finder"
set tempTwo to a reference to file (my dailyServerFolder & ":" & temp as text)
end tell
save document 1 in tempTwo
end tell
which gives an error of
Finder got an error: Can’t get file "Jobs:Yearly Email Storage 2015:09:2015 09 24:2015-09-24 015737:2015-09-24 003154 Cover Sheet.rtfd”.
Can someone set me straight on how to do this, please. It’s extremely important.
Regards
Santa