text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
tell application "Finder" to set label index of currentFile to 7 | AutoConvert.scpt |
tell application "Finder" to set origFilepath to POSIX path of (currentFile as alias) | AutoConvert.scpt |
set logFilepath to (characters 1 thru -5 of origFilepath as string) & ".log" | AutoConvert.scpt |
set partDuplicate to 1 | AutoConvert.scpt |
set partFilepath to (characters 1 thru -5 of origFilepath as string) & ".hb" | AutoConvert.scpt |
repeat while fileExists(POSIX file partFilepath) | AutoConvert.scpt |
set partDuplicate to partDuplicate + 1 | AutoConvert.scpt |
set partFilepath to (characters 1 thru -5 of origFilepath as string) & " " & partDuplicate & ".hb" | AutoConvert.scpt |
set shellCommand to "nice " & handbrakeLocation & " -i '" & origFilepath & "' -o '" & partFilepath & "' --preset='High Profile'" & " // &> '" & logFilepath & "'" | AutoConvert.scpt |
do shell script shellCommand | AutoConvert.scpt |
tell application "Finder" to set label index of currentFile to 6 | AutoConvert.scpt |
set partFile to (POSIX file partFilepath as alias) | AutoConvert.scpt |
set newDuplicate to 1 | AutoConvert.scpt |
tell application "Finder" to set partFilename to name of partFile | AutoConvert.scpt |
set newFilename to (characters 1 thru -3 of partFilename as string) & "m4v" | AutoConvert.scpt |
set newFilepath to replaceText(partFilename, newFilename, partFilepath) | AutoConvert.scpt |
repeat while fileExists(POSIX file newFilepath) | AutoConvert.scpt |
set newDuplicate to newDuplicate + 1 | AutoConvert.scpt |
set newFilename to (characters 1 thru -4 of partFilename as string) & " " & newDuplicate & ".m4v" | AutoConvert.scpt |
set name of partFile to newFilename | AutoConvert.scpt |
set label index of partFile to 6 | AutoConvert.scpt |
set shellCommand to "rm -f " & logFilepath | AutoConvert.scpt |
set allFiles to every file of entire contents of (POSIX file torrentsLocation as alias) whose ((name extension is "m4v" or name extension is "mp4") and label index is 6) | AutoConvert.scpt |
set label index of currentFile to 0 | AutoConvert.scpt |
tell application "iFlicks" | AutoConvert.scpt |
import (currentFile as alias) as QuickTime movie with deleting without gui | AutoConvert.scpt |
set dest to make new text document | move_document_to_new_bbedit_window.applescript |
select dest | move_document_to_new_bbedit_window.applescript |
set oldLocation to text window 2 | move_document_to_new_bbedit_window.applescript |
move document 1 of oldLocation to dest's window | move_document_to_new_bbedit_window.applescript |
set files visible of dest's window to false | move_document_to_new_bbedit_window.applescript |
set bounds of dest's window to {20, 20, 700, 1400} -- guesses at your resolution. Use Applescript Editor and the Record functionality to find the right values for you | move_document_to_new_bbedit_window.applescript |
set theURLs to {} | Chrome tab URLs to clipboard.scpt |
repeat with i from 1 to (count of tabs) | Chrome tab URLs to clipboard.scpt |
set end of theURLs to URL of tab i | Chrome tab URLs to clipboard.scpt |
set oldDelims to AppleScript's text item delimiters | Chrome tab URLs to clipboard.scpt |
set AppleScript's text item delimiters to (ASCII character 10) | Chrome tab URLs to clipboard.scpt |
set URL_list to theURLs as text | Chrome tab URLs to clipboard.scpt |
set the clipboard to resub(URL_list, "chrome-extension://[a-z]+/suspended.html#(?:ttl=[^&]+&)?(?:pos=[0-9]+&)?uri=", "") | Chrome tab URLs to clipboard.scpt |
set AppleScript's text item delimiters to oldDelims | Chrome tab URLs to clipboard.scpt |
display notification (the clipboard) | Chrome tab URLs to clipboard.scpt |
on resub(theText, regex, substitute) | Chrome tab URLs to clipboard.scpt |
do shell script "ruby <<ahz3Yaazah2see | Chrome tab URLs to clipboard.scpt |
raw_text = <<voh2veemeecaoZ | Chrome tab URLs to clipboard.scpt |
" & theText & " | Chrome tab URLs to clipboard.scpt |
voh2veemeecaoZ | Chrome tab URLs to clipboard.scpt |
puts raw_text.gsub(%r{" & regex & "},%Q{" & substitute & "}) | Chrome tab URLs to clipboard.scpt |
ahz3Yaazah2see" | Chrome tab URLs to clipboard.scpt |
end resub | Chrome tab URLs to clipboard.scpt |
set batteryPercent to do shell script "pmset -g batt | awk '/InternalBattery/ { sub(/;/, \"\"); print $2 }'" | Get Battery Percentage.applescript |
display dialog "Battery is " & batteryPercent & " charged." buttons {"OK"} default button "OK" | Get Battery Percentage.applescript |
on toString(anyObj) | ExploringTypicalObjectModel.applescript |
local i, txt, errMsg, orgTids, oName, oId, prefix | ExploringTypicalObjectModel.applescript |
set txt to "" | ExploringTypicalObjectModel.applescript |
repeat with i from 1 to 2 | ExploringTypicalObjectModel.applescript |
if i is 1 then | ExploringTypicalObjectModel.applescript |
if class of anyObj is list then | ExploringTypicalObjectModel.applescript |
set {orgTids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {", "}} | ExploringTypicalObjectModel.applescript |
set txt to ("{" & anyObj as string) & "}" | ExploringTypicalObjectModel.applescript |
set AppleScript's text item delimiters to orgTids # ' | ExploringTypicalObjectModel.applescript |
set txt to anyObj as string | ExploringTypicalObjectModel.applescript |
set txt to properties of anyObj as string | ExploringTypicalObjectModel.applescript |
on error errMsg | ExploringTypicalObjectModel.applescript |
set txt to do shell script "egrep -o '\\{.*\\}' <<< " & quoted form of errMsg | ExploringTypicalObjectModel.applescript |
if txt is not "" then exit repeat | ExploringTypicalObjectModel.applescript |
set prefix to "" | ExploringTypicalObjectModel.applescript |
if class of anyObj is not in {text, integer, real, boolean, date, list, record} and anyObj is not missing value then | ExploringTypicalObjectModel.applescript |
set prefix to "[" & class of anyObj | ExploringTypicalObjectModel.applescript |
set oName to "" | ExploringTypicalObjectModel.applescript |
set oId to "" | ExploringTypicalObjectModel.applescript |
set oName to name of anyObj | ExploringTypicalObjectModel.applescript |
if oName is not missing value then set prefix to prefix & " name=\"" & oName & "\"" | ExploringTypicalObjectModel.applescript |
set oId to id of anyObj | ExploringTypicalObjectModel.applescript |
if oId is not missing value then set prefix to prefix & " id=" & oId | ExploringTypicalObjectModel.applescript |
set prefix to prefix & "] " | ExploringTypicalObjectModel.applescript |
return prefix & txt | ExploringTypicalObjectModel.applescript |
end toString | ExploringTypicalObjectModel.applescript |
on dlog(anyObjOrListOfObjects) | ExploringTypicalObjectModel.applescript |
global DLOG_TARGETS | ExploringTypicalObjectModel.applescript |
if length of DLOG_TARGETS is 0 then return | ExploringTypicalObjectModel.applescript |
if class of anyObjOrListOfObjects is not list then set anyObjOrListOfObjects to {anyObjOrListOfObjects} | ExploringTypicalObjectModel.applescript |
local lst, i, txt, errMsg, orgTids, oName, oId, prefix, logTarget, txtCombined, prefixTime, prefixDateTime | ExploringTypicalObjectModel.applescript |
set lst to {} | ExploringTypicalObjectModel.applescript |
repeat with anyObj in anyObjOrListOfObjects | ExploringTypicalObjectModel.applescript |
set {orgTids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {", "}} # ' | ExploringTypicalObjectModel.applescript |
set txt to prefix & txt | ExploringTypicalObjectModel.applescript |
set lst to lst & txt | ExploringTypicalObjectModel.applescript |
set {orgTids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {" "}} # ' | ExploringTypicalObjectModel.applescript |
set txtCombined to lst as string | ExploringTypicalObjectModel.applescript |
set prefixTime to "[" & time string of (current date) & "] " | ExploringTypicalObjectModel.applescript |
set prefixDateTime to "[" & short date string of (current date) & " " & text 2 thru -1 of prefixTime | ExploringTypicalObjectModel.applescript |
repeat with logTarget in DLOG_TARGETS | ExploringTypicalObjectModel.applescript |
if contents of logTarget is "log" then | ExploringTypicalObjectModel.applescript |
log prefixTime & txtCombined | ExploringTypicalObjectModel.applescript |
else if contents of logTarget is "alert" then | ExploringTypicalObjectModel.applescript |
display alert prefixTime & txtCombined | ExploringTypicalObjectModel.applescript |
else if contents of logTarget is "syslog" then | ExploringTypicalObjectModel.applescript |
do shell script "logger -t " & quoted form of ("AS: " & (name of me)) & " " & quoted form of txtCombined | ExploringTypicalObjectModel.applescript |
else # assumed to be a POSIX file path to *append* to. | ExploringTypicalObjectModel.applescript |
set fpath to contents of logTarget | ExploringTypicalObjectModel.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.