text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
if (count of words of p) > 0 then | WFO-to-Calendar.applescript |
if first word of p is in daysofweek then | WFO-to-Calendar.applescript |
set theday to first word of p | WFO-to-Calendar.applescript |
set thedate to my extractBetween(p, ", ", return) | WFO-to-Calendar.applescript |
set datastart to n | WFO-to-Calendar.applescript |
set segdata to {} | WFO-to-Calendar.applescript |
set segmentend to false | WFO-to-Calendar.applescript |
log paragraph n of wfoText | WFO-to-Calendar.applescript |
if word 1 of paragraph n of wfoText is not in daysofweek and paragraph n of wfoText is not "YOUR SCHEDULE EDITS" then | WFO-to-Calendar.applescript |
if paragraph n of wfoText does not contain "Clear day" then | WFO-to-Calendar.applescript |
set end of segdata to paragraph n of wfoText | WFO-to-Calendar.applescript |
set end of scheduleData to {_dow:theday, _date:thedate, segments:segdata} | WFO-to-Calendar.applescript |
if paragraph n of wfoText is "Loading complete" then | WFO-to-Calendar.applescript |
set dataScraped to true | WFO-to-Calendar.applescript |
return scheduleData | WFO-to-Calendar.applescript |
end parseWFOtext | WFO-to-Calendar.applescript |
error "Script timed out, Schedule Editor not found" & return & "Login to WFO and click the Schedule Editor link and try again" number -100 | WFO-to-Calendar.applescript |
property ClientName : "Textual" | sm4.scpt |
property ScriptName : "sm" | sm4.scpt |
property ScriptDescription : "A Script Manager Script for Textual" | sm4.scpt |
property ScriptHomepage : "http://xeon3d.net/textual/sm" | sm4.scpt |
property ScriptDownloadFolderURL : "http://xeon3d.net/textual/sm/" | sm4.scpt |
property ScriptAuthorHomepage : "http://www.xeon3d.net" | sm4.scpt |
property CurrentVersion : "1.0.1" | sm4.scpt |
if ClientName is "Textual" then | sm4.scpt |
if ClientVersion > "2.0.99" then | sm4.scpt |
set ExternalScriptsPath to (the POSIX path of (path to application support from the user domain) & "Textual IRC/Scripts/") as string | sm4.scpt |
set QExternalScriptsPath to the quoted form of (the POSIX path of (path to application support from the user domain) & "Textual IRC/Scripts/") | sm4.scpt |
set ExternalScriptsPath to (the POSIX path of (path to application support from the user domain) & "Textual/Scripts/") as string | sm4.scpt |
set QExternalScriptsPath to the quoted form of (the POSIX path of (path to application support from the user domain) & "Textual/Scripts/") | sm4.scpt |
set TempDirPath to the quoted form of (the POSIX path of (path to temporary items from the user domain)) | sm4.scpt |
set UpdateZipPath to the quoted form of (the POSIX path of (path to temporary items from the user domain) & "update.zip") | sm4.scpt |
set Report to "" | sm4.scpt |
set ScriptsInstalled to 0 | sm4.scpt |
set ScriptsRemoved to 0 | sm4.scpt |
if cmd is "update" then | sm4.scpt |
do shell script "defaults write xeon3d.sd LatestURL " & ScriptDownloadFolderURL & "latest" | sm4.scpt |
do shell script "defaults write xeon3d.sd LatestMD5URL " & ScriptDownloadFolderURL & "latestmd5" | sm4.scpt |
set LatestVersionURL to do shell script "defaults read xeon3d.sd LatestURL" | sm4.scpt |
set LatestChecksum to do shell script "defaults read xeon3d.sd LatestMD5URL" | sm4.scpt |
set LatestVersion to do shell script "curl " & LatestVersionURL | sm4.scpt |
set LatestChecksum to do shell script "curl " & LatestChecksum | sm4.scpt |
set LatestZip to ScriptDownloadFolderURL & ScriptName & "-" & LatestVersion & ".zip" | sm4.scpt |
if LatestVersion contains "DOCTYPE" then | sm4.scpt |
return "/debug echo Error getting the latest " & ScriptName & " version number. Please try again later or visit " & ScriptHomepage & " for more information." | sm4.scpt |
if LatestVersion is greater than CurrentVersion then | sm4.scpt |
do shell script "rm -f " & UpdateZipPath | sm4.scpt |
do shell script "curl -C - " & LatestZip & " -o " & UpdateZipPath | sm4.scpt |
if LatestChecksum is not (do shell script "md5 -q " & UpdateZipPath) then | sm4.scpt |
if LatestChecksum contains "DOCTYPE" then | sm4.scpt |
return "/debug echo Error getting the online checksum for the latest " & ScriptName & " version. Please try again later or download newest version here: " & ScriptHomepage | sm4.scpt |
return "/debug echo The " & ScriptName & " download was corrupted. Local MD5: " & (do shell script "md5 -q " & UpdateZipPath) & " - Online MD5: " & LatestChecksum & " . Please try again later or visit " & ScriptHomepage & " for more info." | sm4.scpt |
set DownloadedUpdateCheck to do shell script "unzip -t " & UpdateZipPath | sm4.scpt |
if DownloadedUpdateCheck contains "No errors detected" then | sm4.scpt |
do shell script "rm -f " & QExternalScriptsPath & "/sd*.scpt" | sm4.scpt |
do shell script "unzip -o " & UpdateZipPath & " -d " & QExternalScriptsPath | sm4.scpt |
set ResultMessage to "/echo Successfully updated " & ScriptName & " to version " & LatestVersion & " from " & CurrentVersion & "." | sm4.scpt |
return ResultMessage | sm4.scpt |
else if DownloadedUpdateCheck contains "cannot find" then | sm4.scpt |
set ResultMessage to "/echo Error extracting " & ScriptName & ". Try again later or download a previous version from " & ScriptHomepage | sm4.scpt |
else if LatestVersion is equal to CurrentVersion then | sm4.scpt |
set ResultMessage to "/echo " & ScriptName & " is already up to date. (Your script version: " & CurrentVersion & "; Latest released script version: " & LatestVersion & ")" | sm4.scpt |
else if CurrentVersion is greater than LatestVersion then | sm4.scpt |
set ResultMessage to "/echo Your copy of " & ScriptName & " is newer than the last released version. (Your script version: " & CurrentVersion & "; Latest released script version: " & LatestVersion & ")" | sm4.scpt |
set msg to " • Script Version: " & ScriptName & space & CurrentVersion & " for " & ClientName & " by " & ScriptAuthor & ". Get it @ " & ScriptHomepage & " •" | sm4.scpt |
set msg to "/echo • Possible Options:" & NewLine & ¬ | sm4.scpt |
"/echo • To change an option type '/" & ScriptName & " <option name> toggle'. Example: /" & ScriptName & " simple toggle " & NewLine & ¬ | sm4.scpt |
"/echo • Sadly there are no options at the moment for SM" | sm4.scpt |
if cmd is "list" then | sm4.scpt |
"/echo To install or update a script type '/" & ScriptName & "install <script name>'. Example: /" & ScriptName & " install si" & NewLine & ¬ | sm4.scpt |
"/echo Available Scripts:" & NewLine | sm4.scpt |
set msg to msg & Echo & " • " & ItemName & tab & tab & ItemVersion & " : " & ItemDescription & NewLine | sm4.scpt |
"/echo • " & FBold & "Usage:" & FBold & " /" & ScriptName & " [option] [parameter]" & NewLine & ¬ | sm4.scpt |
"/echo • To install a script type '/" & ScriptName & "install 'scriptname'" & NewLine & ¬ | sm4.scpt |
"/echo • To get all of the available scripts type '/" & ScriptName & "install all" & NewLine & ¬ | sm4.scpt |
"/echo • There are also some special labels: 'about' shows some info about the script; " & NewLine & ¬ | sm4.scpt |
"/echo • The 'list' label will show you a list of available scripts…" & NewLine & ¬ | sm4.scpt |
"/echo • The 'option' label will show you a list of available options…" & NewLine & ¬ | sm4.scpt |
"/echo • The 'help' label erm … I'd guess you just discovered what it does... " & NewLine & ¬ | sm4.scpt |
"/echo • The 'version' label shows information about the version." | sm4.scpt |
"/echo • " & FBold & ScriptName & " " & CurrentVersion & FBold & " - " & ScriptDescription & NewLine & ¬ | sm4.scpt |
"/echo • Homepage: " & ScriptHomepage & NewLine & ¬ | sm4.scpt |
"/echo • Coded by " & ScriptAuthor & " - " & ScriptAuthorHomepage & NewLine | sm4.scpt |
if cmd is "install all" or cmd is "remove all" then | sm4.scpt |
set Report to Report & Echo & "Multiple Scripts Report:" & NewLine | sm4.scpt |
else if cmd contains "install" or cmd contains "remove" then | sm4.scpt |
set Report to Report & Echo & " Report:" & NewLine | sm4.scpt |
if cmd contains "install" then | sm4.scpt |
set ChosenScript to the last word of cmd | sm4.scpt |
if ChosenScript is "all" then | sm4.scpt |
do shell script "curl -s " & RepositoryContentsURL & " | grep " & ChosenScript | sm4.scpt |
set OnlineVersion to second word of currentItem | sm4.scpt |
set OnlineChecksum to the last text item of currentItem | sm4.scpt |
set CurrentItemPath to ExternalScriptsPath & ItemName & ".scpt" | sm4.scpt |
set IsItInstalled to FileExists(CurrentItemPath) | sm4.scpt |
if IsItInstalled then | sm4.scpt |
set CurrentAction to "updated" | sm4.scpt |
set CurrentAction to "installed" | sm4.scpt |
set InstalledVersion to do shell script "grep -m 1 CurrentVersion " & quoted form of CurrentItemPath & " | awk -F\\\" {'print $2'}" | sm4.scpt |
if OnlineVersion > InstalledVersion then | sm4.scpt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.