Hi! Is it possible to take a screenshot of the entire screen, and then send it over iChat?
Any help would be appreciated!
Hi! Is it possible to take a screenshot of the entire screen, and then send it over iChat?
Any help would be appreciated!
Hi,
simple solution
set screenShotFile to (path to desktop as text) & "screenshot_" & (do shell script "date +%Y%m%d%H%M%S") & ".png"
do shell script "screencapture -m " & quoted form of POSIX path of screenShotFile
delay 1
tell application "iChat"
send file screenShotFile to buddy "myBuddy"
end tell
Thanks! But how do I delay until the buddy has accepted the file and it has transferred, then delete the file that’s on my desktop?
maybe the completed file transfer event handler could do the job
I’m not too sure how I’d go about using it…
the handler will be called automatically when the file transfer is completed.
But I’m not sure whether it responds to file sent or file received.
I guess file sent, because the dictionary says
direct parameter required file transfer The file transfer being sent.
using terms from application "iChat"
on completed file transfer theFileTransfer
-- respond to the event
end completed file transfer
end using terms from
Something like
set screenShotFile to (path to desktop as text) & "screenshot_" & (do shell script "date +%Y%m%d%H%M%S") & ".png"
do shell script "screencapture -m " & quoted form of POSIX path of screenShotFile
tell application "iChat"
send file screenShotFile to buddy "buddy@somewhere.com"
end tell
using terms from application "iChat"
on completed file transfer theFileTransfer
tell application "Finder"
delete screenShotFile
end tell
end completed file transfer
end using terms from
this? But it doesn’t work when run in script editor…
Also, any ideas on how to integrate this with AAIR (in Code Exchange) since plugins can only return text, not images?
the Message Sent event must be hooked up to the script in iChat’s preferences > Alerts
Hey,
Trying to email a screenshot but am having trouble with the attached screenshot.
This sends the email but does not attach the screenshot.jpg image.
The screenshot file shows on the Desktop but without the .jpg extension.
Maybe that’s the problem?
Any idea how to fix?
Many thanks,
Carl
set screenShotFile to (path to desktop as text) & “screenshot.jpg”
do shell script "screencapture -m " & quoted form of POSIX path of screenShotFile
delay 5
tell application “Mail”
set addressList to {“ckeyes@xxxx.net”}
set nameList to {“Carl”}
set bodyvar to “Here is the saved webcam image.”
set subjectvar to “Webcam Image”
set attachmentVar to screenShotFile
set newMessage to (a reference to (make new outgoing message))
tell newMessage
repeat with i from 1 to count nameList
make new to recipient at end of to recipients with properties {name:item i of nameList, address:item i of addressList}
end repeat
set the subject to subjectvar
set the content to bodyvar
tell content
make new attachment with properties {file name:attachmentVar}
end tell
end tell
send newMessage
end tell