.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old January 8th, 2007, 08:08 PM
Psientist's Avatar

Psientist Psientist is offline
Sergeant
 
Join Date: Apr 2004
Location: Tampa Bay, Florida, USA
Posts: 327
Thanks: 5
Thanked 33 Times in 11 Posts
Psientist is on a distinguished road
Default Applescript PBEM support

For us Mac users who host PBEM games - I kludged an applescript to create a drag-and-drop utility that the host (on an OSX Mac) can use to automatically send a PBEM file out to all of her/his players. Since I didn't add much, I leave the original author's credits intact:

Quote:

(* Send Attachment Droplet 1.2 by Joel Swenson, Copyright © 2006
Free for personal use
Modified and expanded version of Apple sample code "Create New Message", Copyright © 2002 Apple Computer
Version History:
1.2 More efficient script, identical functionality.
1.1 Available as a script, instead of application, so that it is more easily editable by other users. Must be saved as an application for droplet function to work.
Added "on run" functionality, prompting user to choose a file to attach.

1.0 Original release
*)
global theSender, theBody, theSubject, theAttachment

on open theFiles
repeat with oneFile in theFiles
tell application "Finder"
set filePath to POSIX path of oneFile
set theAttachment to filePath
end tell
makeMessage()
end repeat
end open

on run
set oneFile to choose file
tell application "Finder"
set filePath to POSIX path of oneFile
set theAttachment to filePath
set theSubject to name of oneFile
end tell
makeMessage()
end run



on makeMessage()
set theBody to "File Attached:"

set theSender to "hostemail@someplace.com" -- edit this line to match the email address of the host.
-- this must be a valid account in your mail.app program!
set theSubject to "Dominions 3 PBEM Game File" -- change this as desired

tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
set sender to theSender
make new to recipient with properties ("player1@otherplace.com") -- change this to one of your players' valid email address
-- make new cc recipient with properties ("player2@otherplace.com") -- add as many of these as you have players!
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
end tell
send newMessage
end tell
end makeMessage

save the script as a run-only app, and put it where it's convenient to access for drag-and-dropping your game file after you have finished hosting a turn. It will automatically open Mail.app, create an email with all appropriate addressees, and send it...saving you a few steps at least.

My test file works, but let me know if you run into errors. I'll probably be working on an applescript to reside inside Mail.app for saving and filing the return gamefiles from the players.

good luck!
Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.