text
stringlengths
0
15.7k
source
stringlengths
6
112
to waitForDownload(listOfFileAliases, delayDuration)
LIB_Files.applescript
repeat with f in listOfFileAliases
LIB_Files.applescript
set oldSize to size of f
LIB_Files.applescript
delay delayDuration
LIB_Files.applescript
set newSize to size of f
LIB_Files.applescript
end waitForDownload
LIB_Files.applescript
to deleteFiles(listOfFileAliases)
LIB_Files.applescript
do shell script ("rm -fr " & file_path)
LIB_Files.applescript
end deleteFiles
LIB_Files.applescript
to filterDocuments(listToFilter, valuesToOmit)
LIB_Files.applescript
set listToFilter to convertDocumentList(listToFilter)
LIB_Files.applescript
set valuesToOmit to convertDocumentList(valuesToOmit)
LIB_Files.applescript
end filterDocuments
LIB_Files.applescript
on fileInfo(this_file)
LIB_Files.applescript
set default_delimiters to AppleScript's text item delimiters
LIB_Files.applescript
if last item of (this_file as string) = ":" then
LIB_Files.applescript
set this_file to (items 1 through -2 of (this_file as string)) as string
LIB_Files.applescript
set this_parent_dir to (text items 1 through -2 of (this_file as string)) as string
LIB_Files.applescript
set this_name to (text item -1 of (this_file as string)) as string
LIB_Files.applescript
set this_extension to the last text item of this_name
LIB_Files.applescript
set this_name to (text items 1 through -2 of this_name) as string
LIB_Files.applescript
set AppleScript's text item delimiters to default_delimiters
LIB_Files.applescript
return {this_parent_dir, this_name, this_extension}
LIB_Files.applescript
end fileInfo
LIB_Files.applescript
on listAliasesToNames(aliasList)
LIB_Files.applescript
repeat with i in aliasList
LIB_Files.applescript
set end of nameList to stripPath(i as text)
LIB_Files.applescript
end listAliasesToNames
LIB_Files.applescript
on stripPath(thePath)
LIB_Files.applescript
set nameStart to (my lastOffset(thePath, ":")) + 1
LIB_Files.applescript
return text nameStart thru (length of thePath) of thePath
LIB_Files.applescript
end stripPath
LIB_Files.applescript
on stripPathPOSIX(thePath)
LIB_Files.applescript
set nameStart to (my lastOffset(thePath, "/")) + 1
LIB_Files.applescript
on stripExtension(pathAsText)
LIB_Files.applescript
set _extStart to lastOffset(pathAsText, ".")
LIB_Files.applescript
if _extStart > 0 then
LIB_Files.applescript
set _nameEnd to _extStart - 1
LIB_Files.applescript
set _nameEnd to length of pathAsText
LIB_Files.applescript
return text 1 thru _nameEnd of pathAsText
LIB_Files.applescript
end stripExtension
LIB_Files.applescript
on posixAlias(posixPath)
LIB_Files.applescript
lstripString(posixPath as text, ":") as alias
LIB_Files.applescript
end posixAlias
LIB_Files.applescript
alias (filePath as text)
LIB_Files.applescript
on aliasDir(thePath)
LIB_Files.applescript
set thePath to thePath as text
LIB_Files.applescript
set thePathRev to (reverse of characters of thePath) as text
LIB_Files.applescript
set dirEnd to (length of thePath) - (offset of ":" in thePathRev) + 1
LIB_Files.applescript
return text 1 thru dirEnd of thePath
LIB_Files.applescript
end aliasDir
LIB_Files.applescript
on applescriptPath(pathToFile)
LIB_Files.applescript
if (offset of hdName in pathToFile) = 0 then
LIB_Files.applescript
set fullPath to hdName
LIB_Files.applescript
if text item 1 of pathToFile is not "/" then
LIB_Files.applescript
set fullPath to fullPath & "/"
LIB_Files.applescript
set fullPath to fullPath & pathToFile
LIB_Files.applescript
set applescriptPath to (POSIX file fullPath) as text
LIB_Files.applescript
if text item 1 of applescriptPath is ":" then
LIB_Files.applescript
set applescriptPath to text 2 thru (length of applescriptPath) of applescriptPath
LIB_Files.applescript
return applescriptPath
LIB_Files.applescript
end applescriptPath
LIB_Files.applescript
display dialog "Name of the Quick Tip" default answer ""
of_quick_tip_template copy.applescript
set pContext to first flattened context where its name = "Quick Tip"
of_quick_tip_template copy.applescript
set myFolder to first flattened folder where its name = "Quick Tips"
of_quick_tip_template copy.applescript
set mainFolder to "Macintosh HD:Users:craigdba:Dropbox:Geek Computers:Posts:quick tips" as alias
of_quick_tip_template copy.applescript
set ffolder to choose folder
folder_count.applescript
set sccripts to every item of ffolder whose kind is "folder"
folder_count.applescript
get count of sccripts
folder_count.applescript
tell database "Super Heroes"
SaveDatabase.scpt
set numrecs to the count records
SaveDatabase.scpt
close database "Super Heroes" saving no
SaveDatabase.scpt
parseByTags({sourceTEXT:"a*bc|d*ef|g", itemStartStr:"*", itemEndStr:"|", includeMarkers:true})
parseByTags.applescript
on parseByTags(prefs)
parseByTags.applescript
set prefs to prefs & {sourceTEXT:null, itemStartStr:null, itemEndStr:null, includeMarkers:false}
parseByTags.applescript
set itemStartStr to itemStartStr of prefs
parseByTags.applescript
set itemEndStr to itemEndStr of prefs
parseByTags.applescript
set numStart to patternCount({sourceTEXT:sourceTEXT, searchString:itemStartStr})
parseByTags.applescript
set numEnd to patternCount({sourceTEXT:sourceTEXT, searchString:itemEndStr})
parseByTags.applescript
if numStart is not equal to numEnd then error "there must be the same number of start and end strings" number -1024
parseByTags.applescript
repeat with oneItem from 1 to numStart
parseByTags.applescript
copy getTextBetween({sourceTEXT:sourceTEXT, beforeTEXT:itemStartStr, afterTEXT:itemEndStr, textItemNum:oneItem + 1, includeMarkers:includeMarkers}) to end of itemList
parseByTags.applescript
return itemList
parseByTags.applescript
error "unable to parseByTags - " & errMsg number errNum
parseByTags.applescript
end parseByTags
parseByTags.applescript
on patternCount(prefs)
parseByTags.applescript
tell application "htcLib" to patternCount(prefs)
parseByTags.applescript
set the_filepath to "~/desktop/ChromePDFout"
savePDF.applescript
save window 1 in the_filepath
savePDF.applescript
fmGUI_ManageScripts_ScriptListFocus({})
fmGUI_ManageScripts_ScriptListFocus.applescript
if exists static text "No scripts" of splitter group 1 of window 1 then
fmGUI_ManageScripts_ScriptListFocus.applescript
set focused of (outline 1 of scroll area 1 of splitter group 1 of window 1) to true
fmGUI_ManageScripts_ScriptListFocus.applescript
error "unable to fmGUI_ManageScripts_ScriptListFocus - " & errMsg number errNum
fmGUI_ManageScripts_ScriptListFocus.applescript
set theLineNumbers to the last source document's selected paragraph range
Open%20Selection%20in%20GitHub.applescript
set thePath to the last source document's path
Open%20Selection%20in%20GitHub.applescript
set theRoot to do shell script "dirname '" & thePath & "'"
Open%20Selection%20in%20GitHub.applescript
set theRepoURL to do shell script "cd '" & theRoot & "'; git remote get-url origin"
Open%20Selection%20in%20GitHub.applescript
set theRepoRelativePath to do shell script "cd '" & theRoot & "'; cd $(git rev-parse --show-toplevel); git ls-files '" & thePath & "'"
Open%20Selection%20in%20GitHub.applescript
set theHash to do shell script "cd '" & theRoot & "'; git rev-parse HEAD"
Open%20Selection%20in%20GitHub.applescript
set theRepoURL to my replace_chars(theRepoURL, "[email protected]:", "https://github.com/")
Open%20Selection%20in%20GitHub.applescript