Posts

Post marked as solved
14 Replies
Hmmm, okay. Although I don't have Xcode either to my knowledge. I don't have a signing identity. Thanks for the tip though.
Post marked as solved
14 Replies
Okay! With a bit of fussing, it's working correctly now. However, I'm still getting those nag messages from Mojave about an application that wants to control Mail and then Finder. I have given the script the required privileges in the Automation pane of the Security and Privacy menu, but that doesn't seem to be enough. Does it need to appear Accessibility as well? I'm not sure if I want the script to "control my computer." The script will work but I have to click through the security warnings, both of them.
Post marked as solved
14 Replies
OK. I'll try that soon as I have some time. Thanks for the assistance.
Post marked as solved
14 Replies
Well, I inserted the code you provided and it does insert a zipped file into a mail message, but it ignores the first half of the script and doesn't actually mail the file, which the original script did. If I rearrange the code to insert the send to address and subject line, I get an error message and it doesn't add the attachment.
Post marked as solved
14 Replies
Okay, I'll try the code you provided and will report back.Concerning the date. I reported it because if I run the script in the Script Editor and view the log, there is an error message after that line, as in the April 13 message. I do not know why it is there. Could it be that this script predates Sierra? Thanks.
Post marked as solved
14 Replies
The problem isn't the date. The date is correctly inserted into the outgoing mail. The problem is that the attachment no longer gets attached to the message. The script is short so I'll post the whole thing. The problem seems to be happening near the bottom. I've made a couple of change to anonymize the script (the parts in italic: my_name, etc.). ----set aFile to (choose file)set zipFilePath to fileZipper(aFile)--Handler to make .zip files (from file or folder path)on fileZipper(myFile) -- deal with folders if (myFile as text) ends with ":" then set {TIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {":"}} set myFile to (text items 1 thru -2 of (myFile as text) as text) set AppleScript's text item delimiters to TIDs end if set zipFile to (myFile & ".zip") as text try do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & (quoted form of (POSIX path of myFile)) & " " & (quoted form of (POSIX path of zipFile)) on error theError display dialog theError end try -- tell application "Finder" set shortname to name of file (zipFile) set theSubject to shortname & " enclosed -- " & (current date) as text set theBody to "Zip archive enclosed." set theName to "my_name" set theAddress to "my-email@gmail.com" set theSender to "firstname_lastname <me@myisp.com>" set theAttachment to POSIX path of zipFile tell application "Mail" set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return} tell newMessage -- Default is false. Determines whether the compose window will -- show on the screen or whether it will happen in the background. set visible to true set sender to theSender make new to recipient at end of to recipients with properties {name:theName, address:theAddress} tell content make new attachment with properties {file name:theAttachment} at before the last paragraph end tell end tell -- Bring the new compose window to the foreground, in all its glory activate send newMessage end tell end tell --the following line deletes the recently created zipFile do shell script "rm " & (quoted form of (POSIX path of zipFile))end fileZipper--end--If I run this and look at the log, I find the following: make new attachment with properties {file name:"/Users/robertb/Desktop/test-file.pdf.zip"} at before last paragraph of content of outgoing message id 4 --> missing value
Post marked as solved
14 Replies
That works fine with the following result:date "Tuesday, April 14, 2020 at 8:01:32 PM"
Post marked as solved
14 Replies
When I run this script, there appear to be a couple of errors in the log, maybe someone can help me resolve them. I'd be happy to post the entire code (it's a short script), but they are as follows:1. current date --> error number -100042. make new attachment with properties {file name:"/Users/robertb/Desktop/some_file.zip"} at before last paragraph of content of outgoing message id 4 --> missing valueThanks.