text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set textMessage to "#alllightsoff" | All Lights Off WEMO.applescript |
set the clipboard to "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | Copy Lorem Ipsum.applescript |
set didRunSystemPreferences to (get running of application "System Preferences") | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
set initialCheckboxValue to -1 | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
set currentCheckboxValue to -1 | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
reveal anchor 2 of pane id "com.apple.preference.universalaccess" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
repeat until tab group 1 of window 1 of process "System Preferences" exists | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
repeat until (name of second radio button of tab group 1 of window 1 of process "System Preferences") is "Accessibility Keyboard" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
click radio button 2 of tab group 1 of window 1 of process "System Preferences" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
set initialCheckboxValue to value of checkbox 1 of tab group 1 of window 1 of process "System Preferences" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
click checkbox 1 of tab group 1 of window 1 of process "System Preferences" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
set currentCheckboxValue to value of checkbox 1 of tab group 1 of window 1 of process "System Preferences" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
if initialCheckboxValue is currentCheckboxValue then | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
repeat until sheet 1 of window 1 of process "System Preferences" exists | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
click button 1 of sheet 1 of window 1 of process "System Preferences" | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
if not didRunSystemPreferences then | de.sidneys.applescript.toggle-macos-accessibility-keyboard.scpt |
click menu item "Sound" of menu "View" of menu bar 1 | Sound Out To Headphones.applescript |
set theRows to every row of table 1 of scroll area 1 of ¬ | Sound Out To Headphones.applescript |
tab group 1 of window "sound" | Sound Out To Headphones.applescript |
set theOutputs to {} as list | Sound Out To Headphones.applescript |
repeat with aRow in theRows | Sound Out To Headphones.applescript |
if (value of text field 1 of aRow as text) ¬ | Sound Out To Headphones.applescript |
is equal to "Headphones" then | Sound Out To Headphones.applescript |
set selected of aRow to true | Sound Out To Headphones.applescript |
set the clipboard to (current date) as string | Copy Current Date & Time copy.applescript |
property UUID_of_imager_counter : "3E3D7F1F-25A0-4875-B7F1-4D91BE32F24C" | Image auto-rename and annotate.applescript |
set leading_zeros to 5 as integer | Image auto-rename and annotate.applescript |
set CaptionCounter to 0 as integer | Image auto-rename and annotate.applescript |
set RepeatCounter to 1 as integer | Image auto-rename and annotate.applescript |
set MenuChoices to {"Replace with current image name", "Replace with custom text", "Replace with custom text + increasing number", "Don't replace current annotation", "Remove current annotation and leave empty", "Add current image name", "Add custom text", "Add custom text + increasing number"} | Image auto-rename and annotate.applescript |
set Choice to choose from list MenuChoices with prompt "The selected images will be renamed according the scheme 'img######'. Please select a method to handle the image annotations: | Image auto-rename and annotate.applescript |
" with title "Auto-rename images and annotate" default items {"Replace with current image name"} | Image auto-rename and annotate.applescript |
if Choice is false then | Image auto-rename and annotate.applescript |
else if text of Choice is {"Replace with custom text"} or text of Choice is {"Replace with custom text + increasing number"} or text of Choice is {"Add custom text"} or text of Choice is {"Add custom text + increasing number"} then | Image auto-rename and annotate.applescript |
set CustomAnnotation to the text returned of (display dialog "Please enter a custom image annotation. Will replace existing annotation." default answer "") | Image auto-rename and annotate.applescript |
set theRecords to every selected record | Image auto-rename and annotate.applescript |
if theRecords = {} then error "Error: Please select at least one DEVONthink Markdown file." | Image auto-rename and annotate.applescript |
set ImageCounterFile to get record with uuid UUID_of_imager_counter | Image auto-rename and annotate.applescript |
show progress indicator "Renaming images" steps (length of theRecords) with cancel button | Image auto-rename and annotate.applescript |
repeat with thisRecord in theRecords | Image auto-rename and annotate.applescript |
step progress indicator "Step " & (RepeatCounter as string) & "/" & (length of theRecords) as string | Image auto-rename and annotate.applescript |
set RepeatCounter to RepeatCounter + 1 | Image auto-rename and annotate.applescript |
set theType to (type of thisRecord) as string | Image auto-rename and annotate.applescript |
if the type of thisRecord is equal to picture then | Image auto-rename and annotate.applescript |
set ImageCounter to the plain text of ImageCounterFile | Image auto-rename and annotate.applescript |
if ImageCounter is "" then | Image auto-rename and annotate.applescript |
set CounterInit to addLeadingZerosToNumber(1, leading_zeros) of me | Image auto-rename and annotate.applescript |
set plain text of ImageCounterFile to CounterInit as string | Image auto-rename and annotate.applescript |
set ImageCounterString to CounterInit as string | Image auto-rename and annotate.applescript |
set ImageCounterString to addLeadingZerosToNumber(((ImageCounter as integer) + 1), leading_zeros) of me as string | Image auto-rename and annotate.applescript |
set plain text of ImageCounterFile to ImageCounterString | Image auto-rename and annotate.applescript |
set TheImageName to thisRecord's name | Image auto-rename and annotate.applescript |
set ExistingComment to the comment of thisRecord | Image auto-rename and annotate.applescript |
if text of Choice is {"Replace with current image name"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to TheImageName | Image auto-rename and annotate.applescript |
else if text of Choice is {"Replace with custom text"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to CustomAnnotation | Image auto-rename and annotate.applescript |
else if text of Choice is {"Replace with custom text + increasing number"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to CustomAnnotation & " " & (CaptionCounter as string) | Image auto-rename and annotate.applescript |
set CaptionCounter to CaptionCounter + 1 | Image auto-rename and annotate.applescript |
else if text of Choice is {"Don't replace current annotation"} then | Image auto-rename and annotate.applescript |
else if text of Choice is {"Remove current annotation and leave empty"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to "" | Image auto-rename and annotate.applescript |
else if text of Choice is {"Add current image name"} then | Image auto-rename and annotate.applescript |
if ExistingComment is not "" then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to ExistingComment & ". " & TheImageName | Image auto-rename and annotate.applescript |
else if text of Choice is {"Add custom text"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to ExistingComment & ". " & CustomAnnotation | Image auto-rename and annotate.applescript |
else if text of Choice is {"Add custom text + increasing number"} then | Image auto-rename and annotate.applescript |
set the comment of thisRecord to ExistingComment & ". " & CustomAnnotation & " " & (CaptionCounter as string) | Image auto-rename and annotate.applescript |
set name of thisRecord to "img" & ImageCounterString | Image auto-rename and annotate.applescript |
on addLeadingZerosToNumber(theNumber, theMaxLeadingZeroCount) | Image auto-rename and annotate.applescript |
set isNegative to theNumber is less than 0 | Image auto-rename and annotate.applescript |
set theThreshold to (10 ^ theMaxLeadingZeroCount) as integer | Image auto-rename and annotate.applescript |
if theNumber is less than theThreshold then | Image auto-rename and annotate.applescript |
if isNegative = true then set theNumber to -theNumber | Image auto-rename and annotate.applescript |
set theLeadingZeros to "" | Image auto-rename and annotate.applescript |
set theDigitCount to length of ((theNumber div 1) as string) | Image auto-rename and annotate.applescript |
set theCharacterCount to (theMaxLeadingZeroCount + 1) - theDigitCount | Image auto-rename and annotate.applescript |
repeat theCharacterCount times | Image auto-rename and annotate.applescript |
set theLeadingZeros to (theLeadingZeros & "0") as string | Image auto-rename and annotate.applescript |
if isNegative = true then set theLeadingZeros to "-" & theLeadingZeros | Image auto-rename and annotate.applescript |
return (theLeadingZeros & (theNumber as text)) as string | Image auto-rename and annotate.applescript |
return theNumber as text | Image auto-rename and annotate.applescript |
end addLeadingZerosToNumber | Image auto-rename and annotate.applescript |
set theExtensions to {"jpg", "png", "gif", "jpeg"} | uploadImagesToImageShack.applescript |
set userAgent to "[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9]" | uploadImagesToImageShack.applescript |
set theUrl to "http://people.cs.clemson.edu/~zhaoyul/development/imageshack/tempIS.php" | uploadImagesToImageShack.applescript |
set theResponses to {} | uploadImagesToImageShack.applescript |
set selectedFiles to selection | uploadImagesToImageShack.applescript |
set fileNum to number of items in selectedFiles | uploadImagesToImageShack.applescript |
if selectedFiles is not {} then | uploadImagesToImageShack.applescript |
repeat with i from 1 to fileNum | uploadImagesToImageShack.applescript |
set theFile to item i of selectedFiles | uploadImagesToImageShack.applescript |
set thePath to POSIX path of (theFile as string) | uploadImagesToImageShack.applescript |
set fileName to (name of theFile) as string | uploadImagesToImageShack.applescript |
set fileExtension to last text item of fileName | uploadImagesToImageShack.applescript |
set the fileExtension to do shell script "echo " & quoted form of (fileExtension) & " | tr A-Z a-z" | uploadImagesToImageShack.applescript |
if fileExtension is in theExtensions then | uploadImagesToImageShack.applescript |
set theResponse to do shell script "curl -A " & quoted form of (userAgent) & " -X POST -F fileupload=@" & quoted form of thePath & " -F upload=Go -F title=" & quoted form of fileName & " " & quoted form of theUrl | uploadImagesToImageShack.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.