This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ACCESS | |
on writeTextToFile(theText, theFile, overwriteExistingContent) | |
try | |
set theFile to theFile as string | |
set theOpenedFile to open for access file theFile with write permission | |
if overwriteExistingContent is true then set eof of theOpenedFile to 0 | |
write theText to theOpenedFile starting at eof | |
close access theOpenedFile | |
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on setFilePath(fileName) | |
set a to POSIX path of ((path to me as text) & "::") | |
set b to a & fileName | |
return b as string | |
end setFilePath | |
#setFilePath("test.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on load_script(_scriptName) | |
tell application "Finder" | |
set _myPath to container of (path to me) as string | |
set _loadPath to (_myPath & _scriptName) as string | |
load script (alias _loadPath) | |
end tell | |
end load_script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sum of numbers in a list | |
on listAvg(theList) | |
set the_list to theList | |
set a to 0 | |
repeat with this_item in the_list | |
set a to a + this_item | |
end repeat | |
set avg to a / (count the_list) | |
return avg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on highest_number(values_list) | |
set the high_amount to "" | |
repeat with i from 1 to the count of the values_list | |
set this_item to item i of the values_list | |
set the item_class to the class of this_item | |
if the item_class is in {integer, real} then | |
if the high_amount is "" then | |
set the high_amount to this_item | |
else if this_item is greater than the high_amount then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on list_remove_dupes(theList) | |
set newList to {} | |
repeat with x from 1 to count of items of theList | |
set n to item x of theList | |
if n is not in newList then set end of newList to n | |
end repeat | |
return newList | |
end list_remove_dupes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
# DATA REFERENCING | |
########################## | |
# Is this word duplicated anywhere in a column of this sheet? | |
IF(COUNTIF(A,A1)>1,"Yes","no") | |
# Grab values from the another sheet | |
SheetName::Table 1::$A1 | |
# Is this word duplicated somewhere in another sheet? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// regexmatch(columnRange, "(?i)x|y|z") | |
regexmatch(A:A, "(?i)term1|term2|term3|term4|term5") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if (gte mso 9)|(IE)]> | |
<style type="text/css"> | |
table { | |
border-collapse: collapse; | |
border-spacing: 0; | |
mso-line-height-rule: exactly; | |
mso-margin-bottom-alt: 0; | |
mso-margin-top-alt: 0; | |
mso-table-lspace: 0pt; mso-table-rspace: 0pt;} | |
</style> |