Home » Industry Watch » The Technological
MacSurfer SubmissionThe script.
There's a reason for this script being online and it's not so you can copy it out to make submissions to MacSurfer yourself. Darren, Phil, and Scott do an enormous job collating thousands of submissions daily and it should come as no surprise they've streamlined their work to reduce the amount of keyboard abuse they have to subject themselves to everyday. If you use this script instead of asking them for their latest script you risk making their lives a lot more troublesome. Never ever use any script for MacSurfer you find online - if you want the script for submissions to MacSurfer write to them and ask them to send you their latest version. Thank you.
Instructions:
- Be at direct URL of story to submit
- Highlight the title
- Run script
- Check over auto-generated email, SEND
property senderName : "<YOUR NAME>"
property senderEmail : space & "<your@mail.address>"
property siteName : "<SITE NAME>"
property |quote| : "\""
property MacSurfer1Name : "Phil Pearson"
property macSurfer1Email : "ppearson@technn.com"
property MacSurfer2Name : "Darren Mahaffy"
property MacSurfer2Email : "dmahaffy@macsurfer.com"
property MacSurfer3Name : "Scott Siegling"
property MacSurfer3Email : "ssiegling@macsurfer.com"
tell application "Safari"
set theURL to URL of document 1 --Safari should be at the page/URL of what you want to submit
set clipText to (do JavaScript "getSelection()" in document 1) as string --make sure you've highlighted your title in Safari
--set clipText to (do JavaScript "unescape(getSelection())" in document 1) as string -- for Safari 2.0
if clipText = "" then --some sites with frames don't allow for the JavaScript above, so copying is the fix
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
keystroke "c" using {command down}
delay 0.5
set clipText to the clipboard
end tell
end tell
end if
end tell
set clipText to fix(clipText) -- parse out leading/trailing space, return
tell application "Mail"
--set sig to signature "your signature" --if you want to add your signature, remove the "--" at beginning of line
--set sig_content to content of sig --also look for the & sig_content below and remove the "--"
-- • • Please Do Not Modify The Following Section • • --
set msg to make new outgoing message
tell msg
make new to recipient at end of to recipients with properties {name:MacSurfer1Name, address:macSurfer1Email}
make new to recipient at end of to recipients with properties {name:MacSurfer2Name, address:MacSurfer2Email}
make new cc recipient with properties {name:MacSurfer3Name, address:MacSurfer3Email}
set sender to senderName & senderEmail
set subject to |quote| & clipText & |quote| -- or something else that is descriptive
set content to "Article submission ...." & return & return ¬
& "<LI>" & |quote| & clipText & |quote| & return & "<A HREF=" & |quote| & theURL & |quote| & ">" & siteName & "</A>" & return & "<BR>" & return & return & "----"
--& sig_content -- if you want to add your signature, remove the "--" before the ampersand (&)
tell content of msg
set the size to 11
set the font to "Verdana"
set the color of every paragraph to {0, 0, 0}
end tell
set visible to true
end tell
activate
end tell
--This script was written by Darren Mahaffy (dmahaffy@macsufer.com), Managing Editor of MacSurfer. Feel free to modify for your use except for the areas marked "Please Do Not Modify".
--Please Do Not Modify Handler Below--
on fix(clipText) --parse out leading spaces, non-space spaces, return
repeat
set n to count characters in clipText
if character 1 of clipText = " " or character 1 of clipText = " " or character 1 of clipText = return then
set clipText to characters 2 through n of clipText
set clipText to clipText as text
else
exit repeat
end if
end repeat
--parse out trailing returns, spaces, non-space spaces
repeat
set n to count characters in clipText
if last character of clipText = return or last character of clipText = " " or last character of clipText = " " then
set clipText to characters 1 through (n - 1) of clipText
set clipText to clipText as text
else
exit repeat
end if
end repeat
return clipText
end fix
|