text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set chosenMailbox to choose from list accountMailboxes with prompt "Please select the mailbox" # choose a mailbox | Mail to Numbers Checkmark.applescript |
set chosenMailbox to item 1 of chosenMailbox # flatten list to string | Mail to Numbers Checkmark.applescript |
set chosenMailboxAndAccount to mailbox chosenMailbox of account "Wintec" #chosenAccount # combine mailbox and account into one variable | Mail to Numbers Checkmark.applescript |
tell me to say "Grabbing Data" | Mail to Numbers Checkmark.applescript |
set senders to sender of messages of chosenMailboxAndAccount # grab list of senders (Name, Email) | Mail to Numbers Checkmark.applescript |
set listOfEmails to {} # variable for emails only | Mail to Numbers Checkmark.applescript |
repeat with i in senders # extract the email addresses from the list of senders | Mail to Numbers Checkmark.applescript |
set end of listOfEmails to extract address from i | Mail to Numbers Checkmark.applescript |
tell me to say "Select the gradebook" | Mail to Numbers Checkmark.applescript |
set openDocuments to name of documents | Mail to Numbers Checkmark.applescript |
set targetFile to choose from list openDocuments with prompt "Select Target File." | Mail to Numbers Checkmark.applescript |
set targetFile to item 1 of targetFile | Mail to Numbers Checkmark.applescript |
tell me to say "transfering data" | Mail to Numbers Checkmark.applescript |
tell document targetFile | Mail to Numbers Checkmark.applescript |
set rowData to value of cells of row 1 | Mail to Numbers Checkmark.applescript |
if chosenMailbox is not in rowData then | Mail to Numbers Checkmark.applescript |
set value of first cell of last column to chosenMailbox | Mail to Numbers Checkmark.applescript |
tell row 1 # find email column | Mail to Numbers Checkmark.applescript |
set columnAddress to address of column of first cell whose value contains "email" | Mail to Numbers Checkmark.applescript |
set gradebookEmails to value of cells of column columnAddress | Mail to Numbers Checkmark.applescript |
set columnToUpdate to column of (first cell whose value is chosenMailbox) | Mail to Numbers Checkmark.applescript |
set emailsThatDoNotMatch to {} | Mail to Numbers Checkmark.applescript |
set gradedLoopCounter to 0 | Mail to Numbers Checkmark.applescript |
repeat with email in listOfEmails | Mail to Numbers Checkmark.applescript |
if email is in gradebookEmails then | Mail to Numbers Checkmark.applescript |
if the value of the cell (address of row of (first cell whose value is email)) of columnToUpdate is false then | Mail to Numbers Checkmark.applescript |
set the value of the cell (address of row of (first cell whose value is email)) of columnToUpdate to true | Mail to Numbers Checkmark.applescript |
set gradedLoopCounter to gradedLoopCounter + 1 | Mail to Numbers Checkmark.applescript |
set end of emailsThatDoNotMatch to email | Mail to Numbers Checkmark.applescript |
say "finshed and checked " & gradedLoopCounter & " checkboxes" | Mail to Numbers Checkmark.applescript |
set err to "" | CreateGoogleChromeApp.scpt |
set gChromeOrigPath to POSIX path of (path to application "Google Chrome") as text | CreateGoogleChromeApp.scpt |
set gAppRoot to dirname(get characters 1 thru -1 of gChromeOrigPath as string) | CreateGoogleChromeApp.scpt |
set gChromePath to quoted form of (gChromeOrigPath & "Contents/MacOS/Google Chrome") | CreateGoogleChromeApp.scpt |
set gAppName to "" | CreateGoogleChromeApp.scpt |
set gAppNameTxt to "What should the Application be called?" | CreateGoogleChromeApp.scpt |
repeat until gAppName is not "" | CreateGoogleChromeApp.scpt |
set gAppName to the text returned of (display dialog gAppNameTxt default answer "") | CreateGoogleChromeApp.scpt |
if gAppName is not "" then | CreateGoogleChromeApp.scpt |
if CheckExistence(POSIX file (gAppRoot & "/" & gAppName & ".app")) then | CreateGoogleChromeApp.scpt |
set gAppNameTxt to "an Application called \"" & gAppName & "\" already exists, choose a different name." | CreateGoogleChromeApp.scpt |
do shell script "rm -rf /tmp/" & ReplaceText(gAppName, " ", "\\ ") | CreateGoogleChromeApp.scpt |
do shell script "rm -rf /tmp/" & ReplaceText(gAppName & ".app", " ", "\\ ") | CreateGoogleChromeApp.scpt |
set gAppFolder to make new folder at (POSIX file "/tmp") with properties {name:gAppName} | CreateGoogleChromeApp.scpt |
set gContFolder to make new folder at gAppFolder with properties {name:"Contents"} | CreateGoogleChromeApp.scpt |
make new folder at gContFolder with properties {name:"Resources"} | CreateGoogleChromeApp.scpt |
make new folder at gContFolder with properties {name:"MacOS"} | CreateGoogleChromeApp.scpt |
make new folder at gContFolder with properties {name:"Profile"} | CreateGoogleChromeApp.scpt |
set gAppURL to the text returned of (display dialog "What is the web address? | CreateGoogleChromeApp.scpt |
Provide the full URL, with http:// | CreateGoogleChromeApp.scpt |
or a local html file path in the form | CreateGoogleChromeApp.scpt |
file:///Users/myname/Documents/somefile.html" default answer "") | CreateGoogleChromeApp.scpt |
set gAppIcon to POSIX path of ((gContFolder as string) & "Resources:icon.") | CreateGoogleChromeApp.scpt |
set gotIcon to false | CreateGoogleChromeApp.scpt |
repeat until gotIcon | CreateGoogleChromeApp.scpt |
set gAppIconSrc to choose file with prompt "Select an icon for the new app, it must be a perfect square (width=height) | CreateGoogleChromeApp.scpt |
click Cancel to use the default Chrome icon" of type {"public.jpeg", "public.png", "public.tiff", "com.apple.icns"} without invisibles | CreateGoogleChromeApp.scpt |
set iconUTI to type identifier of gAppIconSrc | CreateGoogleChromeApp.scpt |
if iconUTI is equal to "com.apple.icns" then | CreateGoogleChromeApp.scpt |
do shell script "cp -p " & ReplaceText(POSIX path of gAppIconSrc, " ", "\\ ") & " " & ReplaceText(gAppIcon & "icns", " ", "\\ ") | CreateGoogleChromeApp.scpt |
set gotIcon to true | CreateGoogleChromeApp.scpt |
set this_image to open gAppIconSrc | CreateGoogleChromeApp.scpt |
copy dimensions of this_image to {W, H} | CreateGoogleChromeApp.scpt |
if W is equal to H then | CreateGoogleChromeApp.scpt |
scale this_image to size 128 | CreateGoogleChromeApp.scpt |
save this_image as TIFF in gAppIcon & "tiff" | CreateGoogleChromeApp.scpt |
do shell script "tiff2icns -noLarge " & quoted form of (gAppIcon & "tiff") & " >& /dev/null" | CreateGoogleChromeApp.scpt |
on error errText number errNum from frErr to toErr | CreateGoogleChromeApp.scpt |
do shell script "cp -p " & quoted form of (POSIX path of gChromeOrigPath & "Contents/Resources/app.icns") & " " & quoted form of (gAppIcon & "icns") | CreateGoogleChromeApp.scpt |
set err to "Some error occured while processing the image: " & errText & " (" & errNum & ")" | CreateGoogleChromeApp.scpt |
if err is equal to "" then | CreateGoogleChromeApp.scpt |
set gExecCont to "#!/bin/sh | CreateGoogleChromeApp.scpt |
iam=\"$0\" | CreateGoogleChromeApp.scpt |
profDir=$(dirname \"$iam\") | CreateGoogleChromeApp.scpt |
profDir=$(dirname \"$profDir\") | CreateGoogleChromeApp.scpt |
profDir=\"$profDir/Profile\" | CreateGoogleChromeApp.scpt |
exec " & gChromePath & " --user-data-dir=\"$profDir\" \"$@\" \"" & gAppURL & "\"" | CreateGoogleChromeApp.scpt |
set gExecutable to (gContFolder as string) & "MacOS:" & gAppName | CreateGoogleChromeApp.scpt |
set fp1 to open for access gExecutable with write permission | CreateGoogleChromeApp.scpt |
write gExecCont to fp1 | CreateGoogleChromeApp.scpt |
close access fp1 | CreateGoogleChromeApp.scpt |
do shell script "chmod 755 " & quoted form of POSIX path of gExecutable | CreateGoogleChromeApp.scpt |
set gPlistCont to "<?xml version=\"1.0\" encoding=\"UTF-8\"?> | CreateGoogleChromeApp.scpt |
<key>CFBundleExecutable</key> | CreateGoogleChromeApp.scpt |
<string>" & gAppName & "</string> | CreateGoogleChromeApp.scpt |
<key>CFBundleIconFile</key> | CreateGoogleChromeApp.scpt |
<string>icon</string> | CreateGoogleChromeApp.scpt |
</plist> | CreateGoogleChromeApp.scpt |
set fp2 to open for access ((gContFolder as string) & "Info.plist") with write permission | CreateGoogleChromeApp.scpt |
write gPlistCont to fp2 | CreateGoogleChromeApp.scpt |
close access fp2 | CreateGoogleChromeApp.scpt |
set gApp to gAppName & ".app" | CreateGoogleChromeApp.scpt |
set name of gAppFolder to gApp | CreateGoogleChromeApp.scpt |
move (POSIX file ("/tmp/" & gApp) as alias) to folder (POSIX file (gAppRoot & "/") as alias) | CreateGoogleChromeApp.scpt |
display dialog gAppRoot & "/" & gAppName & ".app is ready | CreateGoogleChromeApp.scpt |
You can move this new app to any convinient folder. | CreateGoogleChromeApp.scpt |
NOTE!! if you move the Google Chrome.app away from " & gAppRoot & "/, this new app shortcut will stop working and you'll have to remake it again." buttons {"OK"} default button "OK" | CreateGoogleChromeApp.scpt |
tell application "Finder" to delete gAppFolder | CreateGoogleChromeApp.scpt |
display dialog err & " | CreateGoogleChromeApp.scpt |
Close this dialog, no harm was done, but no app either." buttons {"OK"} default button "OK" | CreateGoogleChromeApp.scpt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.