text stringlengths 0 15.7k | source stringlengths 6 112 |
|---|---|
if (exists (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs)) then | fmGUI_ManageScripts_FmScript_Select.applescript |
select (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
set scriptNowSelected to true | fmGUI_ManageScripts_FmScript_Select.applescript |
else -- if NOT found, then seek by alternate patterns, if specified: | fmGUI_ManageScripts_FmScript_Select.applescript |
set scriptNowSelected to false | fmGUI_ManageScripts_FmScript_Select.applescript |
my fmGUI_ManageScripts_SearchBoxClear({}) | fmGUI_ManageScripts_FmScript_Select.applescript |
repeat with oneAltPattern in altPatterns of prefs | fmGUI_ManageScripts_FmScript_Select.applescript |
set testList to contents of pattern of oneAltPattern | fmGUI_ManageScripts_FmScript_Select.applescript |
if testList is equal to {{}} then | fmGUI_ManageScripts_FmScript_Select.applescript |
set testCode to {} | fmGUI_ManageScripts_FmScript_Select.applescript |
repeat with oneTestRec in testList | fmGUI_ManageScripts_FmScript_Select.applescript |
copy ("" & testType of oneTestRec & " " & quoteString(testMatch of oneTestRec)) to end of testCode | fmGUI_ManageScripts_FmScript_Select.applescript |
set testCode to unParseChars(testCode, betweenTestsCode & scriptNameObjectCode & " ") | fmGUI_ManageScripts_FmScript_Select.applescript |
set testCode to selectCode & rowRefCode & whoseCode & scriptNameObjectCode & " " & testCode & afterAllTestsCode | fmGUI_ManageScripts_FmScript_Select.applescript |
set testCode to testCodeHeader & testCode & testCodeFooter | fmGUI_ManageScripts_FmScript_Select.applescript |
tell me to run script testCode | fmGUI_ManageScripts_FmScript_Select.applescript |
set scriptNowSelected to true -- no error, so we selected it. | fmGUI_ManageScripts_FmScript_Select.applescript |
exit repeat -- no need to keep checking altPatterns | fmGUI_ManageScripts_FmScript_Select.applescript |
if errNum is not -1719 then | fmGUI_ManageScripts_FmScript_Select.applescript |
return scriptNowSelected | fmGUI_ManageScripts_FmScript_Select.applescript |
error "unable to fmGUI_ManageScripts_FmScript_Select '" & fmScriptName of prefs & "' - " & errMsg number errNum | fmGUI_ManageScripts_FmScript_Select.applescript |
end fmGUI_ManageScripts_FmScript_Select | fmGUI_ManageScripts_FmScript_Select.applescript |
on fmGUI_ManageScripts_ScriptListFocus(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
tell application "htcLib" to fmGUI_ManageScripts_ScriptListFocus(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
end fmGUI_ManageScripts_ScriptListFocus | fmGUI_ManageScripts_FmScript_Select.applescript |
tell application "htcLib" to fmGUI_ManageScripts_SearchBoxClear(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
tell application "htcLib" to fmGUI_ManageScripts_SearchBoxFind(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
on quoteString(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
tell application "htcLib" to quoteString(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
end quoteString | fmGUI_ManageScripts_FmScript_Select.applescript |
on unParseChars(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
tell application "htcLib" to unParseChars(prefs) | fmGUI_ManageScripts_FmScript_Select.applescript |
set username to "X-Auth-User: CLOUD_USER" | cloudpaste.scpt |
set authpass to "X-Auth-Key: CLOUD_KEY" | cloudpaste.scpt |
set authurl to "https://lon.auth.api.rackspacecloud.com/v1.0" | cloudpaste.scpt |
set container to "dropbox" | cloudpaste.scpt |
set tmpfile to do shell script "echo '/tmp/'$(uuidgen | tr [:alpha:] [:lower:])" | cloudpaste.scpt |
set filename to do shell script "basename " & tmpfile | cloudpaste.scpt |
do shell script "screencapture -tjpg -s " & tmpfile | cloudpaste.scpt |
set authfile to do shell script "mktemp /tmp/authXXXXXXXX" | cloudpaste.scpt |
do shell script "curl -D " & authfile & " -H '" & username & "' -H '" & authpass & "' " & authurl | cloudpaste.scpt |
set token to do shell script "grep ^X-Auth-Token " & authfile | cloudpaste.scpt |
set storageapi to do shell script "awk '/^X-Storage-Url/{print $2}' " & authfile | cloudpaste.scpt |
set cdnapi to do shell script "awk '/^X-CDN-Management-Url/{print $2}' " & authfile | cloudpaste.scpt |
set cdnurl to "http://alias.domain.com" | cloudpaste.scpt |
do shell script "curl -s -XPUT -H '" & token & "' -H 'Content-Type: image/jpeg' -T '" & tmpfile & "' " & storageapi & "/" & container & "/" & filename & ".jpg" | cloudpaste.scpt |
tell application "Finder" to set the clipboard to cdnurl & "/" & filename & ".jpg" | cloudpaste.scpt |
do shell script "rm -f " & tmpfile | cloudpaste.scpt |
do shell script "rm -f " & authfile | cloudpaste.scpt |
set msg to (item 1 of argv) | msg_to_phone.applescript |
set phoneNum to (item 2 of argv) | msg_to_phone.applescript |
set msgService to 1st service whose service type = iMessage | msg_to_phone.applescript |
set targetBuddy to buddy phoneNum of msgService | msg_to_phone.applescript |
display alert "Sent: {{" & msg & "}}" giving up after 3 | msg_to_phone.applescript |
tell application "System Events" to key code 126 -- up arrow | prev_line.scpt |
File: Shrink or Grow Box at Centre | testjs2.applescript |
Description: The following script runs on a selected box and performs one out of two operations: Shrink / Grow | testjs2.applescript |
(function () {
//************* Default Values - Changes made here are safe
const defaultOperation = "Shrink"; //Valid Values: "Shrink", "Grow"
const defaultSizeChange = 72; //Only in Points, 72pt = 1 inch
//************* Do NOT make changes beyond this point if you don't know JavaScript
const dependencies = ["qx_consta... | testjs2.applescript |
else {
//get the current horizontal measurement units of the layout
let currHorzUnits = qxMeasurements.getUnitsFromString(box.style.qxLeft);
//get the operation to be performed
let operation = getValidOperation();
if (operation != null) {//user cancelled
//input transformation amount
let transformAmt = getTransAmountIn... | testjs2.applescript |
//*****************====================================Functions used in the JavaScript===============================****************// | testjs2.applescript |
//get valid operation input | testjs2.applescript |
function getValidOperation() {
let strPrompt = "Enter the resize operation:";
let strDefaultValue = defaultOperation;
let validValues = ["Shrink", "Grow"];
let boolShowListInPrompt = true;
let boolIsCaseSensitive = false;
return qxInputs.getValidInputFromList(validValues, strPrompt, strDefaultValue, boolShowListInPromp... | testjs2.applescript |
//get valid shrink/grow amount | testjs2.applescript |
function getTransAmountInPts(operation, currHorzUnits, box) {
let amount = null;
let inputStr = "Please enter " + operation + " amount: ";
let boxWidth = qxMeasurements.getBoxWidthInPts(box);
let boxHeight = qxMeasurements.getBoxHeightInPts(box);
operation = operation.toLowerCase();
if (operation == "shrink") {
let max... | testjs2.applescript |
else {
let alertStr = "The selected item cannot be shrunk!";
if (box.style.qxBackgroundColor == "") {
alertStr += "\nerror: Lines cannot be shrunk!";
} | testjs2.applescript |
showResult(alertStr); | testjs2.applescript |
else {
let layout = app.activeLayout();
let pasteboardHt = qxMeasurements.convertAnyUnitToPoints(qxMeasurements.getPasteboardDims(layout).height);
if (qxConstants.debugMode) console.log("pasteboard Height: " + pasteboardHt);
let pasteboardWt = qxMeasurements.convertAnyUnitToPoints(qxMeasurements.getPasteboardDims(layou... | testjs2.applescript |
return amount; | testjs2.applescript |
/*Function to Import Required Libraries | testjs2.applescript |
function importDependencies(list) {
for (i = 0, max = list.length; i < max; i++) {
let dependency = list[i];
let isDefined = null;
switch (dependency) {
case "qx_constants":
isDefined = typeof (qxConstants);
break;
case "qx_create_box":
isDefined = typeof (qxCreateBox);
break;
case "qx_file_io":
isDefined = typeof (qxF... | testjs2.applescript |
if (isDefined == "undefined") {
//import library
app.importScript(app.getAppScriptsFolder() + "/Dependencies/" + dependency + ".js");
console.log("Imported Dependency " + dependency + ".js.");
} | testjs2.applescript |
else {
if (qxConstants.debugMode) console.log("Dependency " + dependency + ".js already loaded.");
} | testjs2.applescript |
/*Function to log Execution Time | testjs2.applescript |
function logTimeTaken() {
endTime = performance.now();
let timeTaken = Math.round((endTime - startTime) / 1000);
console.log("Time Taken: ", timeTaken, " seconds");
} | testjs2.applescript |
/* Function to show Alert and Log | testjs2.applescript |
function showResult(msgString) {
console.log(msgString);
if (!qxConstants.testMode) alert(msgString); //Don't show alerts in TestMode
} | testjs2.applescript |
})(); | testjs2.applescript |
do shell script "touch " & FileName | NewFile.applescript |
if is_running("iCal") then | delete completed todo.applescript |
set cdCommand to "cd ~/Documents/Projects/clauswitt.com; " | Blog%20This.scpt |
set rakeCommand to "rake post title=" | Blog%20This.scpt |
set rakeName to "\"" & theString & "\"" | Blog%20This.scpt |
set completeCommand to cdCommand & rakeCommand & rakeName | Blog%20This.scpt |
set returnValue to do shell script completeCommand | Blog%20This.scpt |
set x to paragraph 4 of returnValue | Blog%20This.scpt |
set x to replaceString(x, "./", "/Users/claus/Documents/Projects/clauswitt.com/") | Blog%20This.scpt |
open x | Blog%20This.scpt |
do shell script "ererer" | test copy 6.applescript |
set {x1, y1, x2, y2} to (bounds of window of desktop) | fullscreener.txt |
repeat with aProcess in processes | fullscreener.txt |
set aProcessName to get name of aProcess | fullscreener.txt |
tell process aProcessName | fullscreener.txt |
set windowCount to (count of windows) | fullscreener.txt |
if windowCount is greater than 0 then | fullscreener.txt |
repeat with aWindow in windows | fullscreener.txt |
set position of aWindow to {x1, y1} | fullscreener.txt |
set size of aWindow to {x2 - x1, y2 - y1} | fullscreener.txt |
set accountName to "NameOfYourAccount" | Outlook_disable_Autodiscover.scpt |
set serverUrl to "https://your.domain.org/your/subpath/Exchange.asmx" | Outlook_disable_Autodiscover.scpt |
set server of every other users folder account of exchange account accountName to serverUrl | Outlook_disable_Autodiscover.scpt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.