Similar Threads:
1.Example: Send email from Perl via AppleScript using Entourage
This Perl script sends a message having a pdf attachment via Entourage
(via an IMAP email account).
Modify "ann_example" per your account.
#!/usr/bin/perl
use Mac::AppleScript qw(RunAppleScript);
# In Preferences you must set uncheck Warn before allowing an external
application to send mail
# You may have to check remember my password when you send a message
from Entourage so you don't get prompted to log in to your IMAP
server.
my $subject = "The igawk file you wanted : Test ACFD1FE";
my $content=<<EOF;
Attached is igawk.1.pdf
Enjoy
EOF
my $recipient = ' XXXX@XXXXX.COM ';
my $script=<<EOF;
tell application "Microsoft Entourage"
activate
set filePath to "Macintosh
HD:Users:ann_example:Documents:igawk.1.pdf"
set msg to make new outgoing message with properties
{subject:"$subject", content:"$content", recipient: "Ann Example <
$recipient>", attachment:alias filePath, account:IMAP account
"ann_example"}
send msg
end tell
EOF
RunAppleScript($script) or die "Didn't work!";
2.Sending email with attachment using AppleScript
Hi I have simple applescript
activate application "Microsoft Entourage"
set filepath to "Macintosh HD:Users:test:del2pdf"
tell application "Microsoft Entourage"
set newMessage to make new draft window
make new attachment at newMessage with properties {file:filepath}
end tell
It works just fine when I call it directly from the script editor.
However I need to execute this script from my application , therefore
I use Carbon framework (see code snippet at the end)
In this case some strange thing happens : sometimes new email message
is created with attachment but attached file has been deleted and when
I click send I got error indicating non-existent attachment file.
Wht;s even more strange that sometimes file is not deleted and sending
is successful.
I double checked my code and I do NOT delete attachment file it
feels like Entourage deletes it before sending email.
Can anybody help with this issue ? Any ideas?
Thanks
David
OSStatus LowRunAppleScript(const void* text, long textLength,
AEDesc *resultData) {
ComponentInstance theComponent;
AEDesc scriptTextDesc;
OSStatus err;
OSAID scriptID, resultID;
/* set up locals to a known state */
theComponent = NULL;
AECreateDesc(typeNull, NULL, 0, &scriptTextDesc);
scriptID = kOSANullScript;
resultID = kOSANullScript;
/* open the scripting component */
theComponent = OpenDefaultComponent(kOSAComponentType,
typeAppleScript);
if (theComponent == NULL) { err = paramErr; goto bail; }
/* put the script text into an aedesc */
err = AECreateDesc(typeChar, text, textLength, &scriptTextDesc);
if (err != noErr) goto bail;
/* compile the script */
err = OSACompile(theComponent, &scriptTextDesc,
kOSAModeNull, &scriptID);
if (err != noErr) goto bail;
/* run the script */
err = OSAExecute(theComponent, scriptID, kOSANullScript,
kOSAModeNull, &resultID);
/* collect the results - if any */
if (resultData != NULL) {
AECreateDesc(typeNull, NULL, 0, resultData);
if (err == errOSAScriptError) {
OSAScriptError(theComponent, kOSAErrorMessage,
typeChar, resultData);
} else if (err == noErr && resultID != kOSANullScript) {
OSADisplay(theComponent, resultID, typeChar,
kOSAModeNull, resultData);
}
}
bail:
AEDisposeDesc(&scriptTextDesc);
if (scriptID != kOSANullScript) OSADispose(theComponent,
scriptID);
if (resultID != kOSANullScript) OSADispose(theComponent,
resultID);
if (theComponent != NULL) CloseComponent(theComponent);
return err;
}
3.Send email from FMP through MS Outlook
FMP 8.02, WIN XP
When we try to send an email from FMP, MS Outlook give us a warning, saying
that,
"A program is automatically try to send an email on your behalf. Do you want
to allow this?"
I assume this is to catch viruses trying to propagate themselves, but it
adds an unnecessary step in our process.
Is there any way to configure Outlook to accept email requests without
question from our FMP file?
Thanks,
Scott C.
4.Can an applescript count open fmp databases?
I am trying to tell filemaker to close all window (databases) but the
front one running this applescript. I cant seem to get the applescript
to properly count the number of open databases. Anyone have a
suggestion.
This is what I have.
tell application "FileMaker Developer"
activate
repeat until (count of windows) = 1
close window 2
end repeat
end tell
Thanks.
Jon Lanclos
XXXX@XXXXX.COM
The Discovery Group Inc.
5.Problem with Applescript on FMP 6 & OSX
I recently switched to OSX 10.3 and am now having problems with my
Applescripts - where I previously was able to use a script to copy text from
Filemaker Pro and paste it into MS Word, I now get one of two messages...
1. The variable paste is not defined (Error -2753) OR
2. Microsoft Word got an error: can continue <event MSWDactv> (Error
?708)
My applescripts looks like this:
tell application "Finder"
activate
select file "e-Letterhead.doc"
open selection
end tell
tell application "Microsoft Word"
paste
end tell
AND
tell application "Finder"
activate
select file "e-Letterhead.doc"
open selection
end tell
tell application "Microsoft Word"
activate
do Visual Basic "Selection.MoveDown Unit:=wdScreen, Count:=1"
do Visual Basic "Selection.EndKey Unit:=wdLine"
paste clipboard
end tell
It also seems to have screwed up for those using it on OS 9.2...
Ie run out of options at the Apple and Filemaker sites... So any help
would be greatly appreciated!
Thanks!
------------------------------------
Debra Clinton
Cambridge Management Planning Inc.
Tel. 416-484-8408 Fax: 416-484-0151
< XXXX@XXXXX.COM >
------------------------------------
6. Applescript as subscript of FMP script
7. FMP 5.5-Applescript Timeout error
8. Unable to send email using "Send As"