text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
));" in "JavaScript"
|
+utils.applescript
|
end define
|
+utils.applescript
|
on synonyms for w
|
+utils.applescript
|
define(w)
|
+utils.applescript
|
end synonyms
|
+utils.applescript
|
to listFrameworks()
|
+utils.applescript
|
set allFrameworks to NSBundle's allFrameworks()'s bundlePath's ¬
|
+utils.applescript
|
lastPathComponent's stringByDeletingPathExtension's ¬
|
+utils.applescript
|
sortedArrayUsingSelector:"caseInsensitiveCompare:"
|
+utils.applescript
|
set fp to path to [my rootdir, "Data", "/", "FRAMEWORKS"]
|
+utils.applescript
|
(allFrameworks's componentsJoinedByString:linefeed) as text
|
+utils.applescript
|
write the result to fp as «class utf8»
|
+utils.applescript
|
end listFrameworks
|
+utils.applescript
|
tell application "Safari"
|
Open URL in Chrome.scpt
|
set i to current tab of window 1
|
Open URL in Chrome.scpt
|
set theUrl to URL of i
|
Open URL in Chrome.scpt
|
tell application "Google Chrome"
|
Open URL in Chrome.scpt
|
if windows is {} then
|
Open URL in Chrome.scpt
|
set this_doc to make new window
|
Open URL in Chrome.scpt
|
my new_tab(theURL)
|
Open URL in Chrome.scpt
|
on error the error_message number the error_number
|
Open URL in Chrome.scpt
|
«event panSdlog» the error_message given «class btns»:{"OK"}, «class dflt»:1
|
Open URL in Chrome.scpt
|
on new_tab(theURL)
|
Open URL in Chrome.scpt
|
set aWin to window 1
|
Open URL in Chrome.scpt
|
tell aWin
|
Open URL in Chrome.scpt
|
set newTab to make new tab with properties {URL:theURL}
|
Open URL in Chrome.scpt
|
end new_tab
|
Open URL in Chrome.scpt
|
global std, plutil, mapLib
|
log4as.applescript
|
global LOG4AS_CONFIG
|
log4as.applescript
|
property initialized : false
|
log4as.applescript
|
property logger : missing value
|
log4as.applescript
|
property Level : {OFF:0, IGNORE:1, DEBUG:2, INFO:3, WARN:4, ERR:5}
|
log4as.applescript
|
property defaultLevel : INFO of Level
|
log4as.applescript
|
property classesLevel : missing value
|
log4as.applescript
|
if name of current application is "Script Editor" then spotCheck()
|
log4as.applescript
|
on spotCheck()
|
log4as.applescript
|
init()
|
log4as.applescript
|
set thisCaseId to "log4as-spotCheck"
|
log4as.applescript
|
logger's start()
|
log4as.applescript
|
set listUtil to std's import("list")
|
log4as.applescript
|
set cases to listUtil's splitByLine("
|
log4as.applescript
|
Manual: Config Info
|
log4as.applescript
|
Manual: Is Printable (un/registered, less, equal, greater, OFF)
|
log4as.applescript
|
")
|
log4as.applescript
|
set spotLib to std's import("spot-test")'s new()
|
log4as.applescript
|
set spot to spotLib's new(thisCaseId, cases)
|
log4as.applescript
|
set {caseIndex, caseDesc} to spot's start()
|
log4as.applescript
|
if caseIndex is 0 then
|
log4as.applescript
|
logger's finish()
|
log4as.applescript
|
set sut to new()
|
log4as.applescript
|
sut's loadPlist() -- force reload each time during spot check.
|
log4as.applescript
|
if caseIndex is 1 then
|
log4as.applescript
|
logger's infof("Default Level: {}", LOG4AS_CONFIG's getValue("defaultLevel"))
|
log4as.applescript
|
logger's infof("Print to console: {}", LOG4AS_CONFIG's getValue("printToConsole"))
|
log4as.applescript
|
logger's infof("Write to file: {}", LOG4AS_CONFIG's getValue("writeToFile"))
|
log4as.applescript
|
log LOG4AS_CONFIG's getValue("categories")'s toString()
|
log4as.applescript
|
else if caseIndex is 2 then
|
log4as.applescript
|
logger's infof("Is Printable INFO log4as.log4as: {}", sut's isPrintable("log4as", INFO of Level))
|
log4as.applescript
|
logger's infof("Is Printable DEBUG log4as.log4as: {}", sut's isPrintable("log4as", DEBUG of Level))
|
log4as.applescript
|
logger's infof("Is Printable DEBUG log4as.$spot: {}", sut's isPrintable("$spot", DEBUG of Level))
|
log4as.applescript
|
logger's infof("Is Printable DEBUG log4as.$spot: {}", sut's isPrintable("$spot", INFO of Level))
|
log4as.applescript
|
logger's infof("Is Printable DEBUG log4as.$spot: {}", sut's isPrintable("$spot", WARN of Level))
|
log4as.applescript
|
spot's finish()
|
log4as.applescript
|
end spotCheck
|
log4as.applescript
|
on new()
|
log4as.applescript
|
script Log4asInstance
|
log4as.applescript
|
on isPrintable(moduleName, logLevel)
|
log4as.applescript
|
repeat with nextClassLevel in classesLevel's getKeys()
|
log4as.applescript
|
set nextClassKey to text 8 thru -1 of nextClassLevel
|
log4as.applescript
|
if moduleName starts with nextClassKey then
|
log4as.applescript
|
set nextClassLevel to classesLevel's getValue(nextClassLevel)
|
log4as.applescript
|
return logLevel is greater than or equal to the _textToInt(nextClassLevel) and _textToInt(nextClassLevel) is not equal to the OFF of Level
|
log4as.applescript
|
logLevel is greater than or equal to my defaultLevel and defaultLevel is not equal to the OFF of Level
|
log4as.applescript
|
end isPrintable
|
log4as.applescript
|
end new
|
log4as.applescript
|
on loadPlist()
|
log4as.applescript
|
set LOG4AS_CONFIG to plutil's new("log4as")
|
log4as.applescript
|
initDefaultLevel()
|
log4as.applescript
|
set classLevel to mapLib's new()
|
log4as.applescript
|
set classesLevel to LOG4AS_CONFIG's getValue("Categories")
|
log4as.applescript
|
if classesLevel is not missing value then
|
log4as.applescript
|
repeat with nextKey in classesLevel's getKeys()
|
log4as.applescript
|
end loadPlist
|
log4as.applescript
|
on initDefaultLevel()
|
log4as.applescript
|
set defaultLevelConfig to LOG4AS_CONFIG's getValueWithDefault("defaultLevel", "INFO")
|
log4as.applescript
|
set defaultLevel to _textToInt(defaultLevelConfig)
|
log4as.applescript
|
end initDefaultLevel
|
log4as.applescript
|
on _textToInt(logLevel)
|
log4as.applescript
|
if logLevel is "INFO" then return INFO of Level
|
log4as.applescript
|
if logLevel is "OFF" then return OFF of Level
|
log4as.applescript
|
if logLevel is "IGNORE" then return IGNORE of Level
|
log4as.applescript
|
if logLevel is "DEBUG" then return DEBUG of Level
|
log4as.applescript
|
if logLevel is "WARN" then return WARN of Level
|
log4as.applescript
|
if logLevel is "ERR" then return ERR of Level
|
log4as.applescript
|
end _textToInt
|
log4as.applescript
|
on init()
|
log4as.applescript
|
if initialized of me then return
|
log4as.applescript
|
set initialized of me to true
|
log4as.applescript
|
set std to script "std"
|
log4as.applescript
|
set logger to std's import("logger")'s new("log4as")
|
log4as.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.