text
stringlengths
0
15.7k
source
stringlengths
6
112
if (count of (windows whose name is not "Log History" and visible is true)) is 0 then return missing value
script-editor.applescript
if (exec of retry on result for 3) is missing value then return missing value
script-editor.applescript
return my _new(id of window 1)
script-editor.applescript
on openFile(posixFilePath)
script-editor.applescript
activate application "Script Editor"
script-editor.applescript
tell application "System Events" to tell process "Script Editor"
script-editor.applescript
if exists (window "Open") then
script-editor.applescript
click button "Cancel" of window "Open"
script-editor.applescript
do shell script "open " & quoted form of posixFilePath
script-editor.applescript
return getFrontTab()
script-editor.applescript
tell application "Script Editor" to open POSIX file posixFilePath
script-editor.applescript
getFrontTab()
script-editor.applescript
on recompileAllOpenDocuments()
script-editor.applescript
repeat with nextDocument in documents
script-editor.applescript
compile nextDocument
script-editor.applescript
end recompileAllOpenDocuments
script-editor.applescript
on _new(windowId)
script-editor.applescript
property theWindow : missing value -- app window, not syseve window.
script-editor.applescript
property suffixedName : missing value
script-editor.applescript
if running of application "Script Editor" is false then return
script-editor.applescript
try -- Fix the nasty bug where it focuses but it's still not considered as the main window targeted by the menu command merge all windows.
script-editor.applescript
click menu item (name of document of my theWindow) of menu 1 of menu bar item "Window" of menu bar 1
script-editor.applescript
set index of my theWindow to 1
script-editor.applescript
on runScript()
script-editor.applescript
script RunScriptInstance
script-editor.applescript
click (first button of toolbar 1 of front window whose description is "Run") -- button "Run" don't seem to work.
script-editor.applescript
logger's debug("Run button found and clicked...")
script-editor.applescript
set runResult to exec of retry on result for 3
script-editor.applescript
logger's debugf("runResult: {}", runResult)
script-editor.applescript
runResult
script-editor.applescript
end runScript
script-editor.applescript
on newTab()
script-editor.applescript
click (first button of tab group "tab bar" of first window whose description is "new tab")
script-editor.applescript
on showLogs()
script-editor.applescript
tell window (name of my theWindow)
script-editor.applescript
set logTabState to (value of first radio button of first radio group whose description is "log") as text
script-editor.applescript
if logTabState is not "1" then click (first radio button of first radio group whose description is "log")
script-editor.applescript
click checkbox "Messages" of group 1 of splitter group 1 of splitter group 1
script-editor.applescript
set maxValue to maximum value of splitter 1 of splitter group 1 of splitter group 1
script-editor.applescript
set value of splitter 1 of splitter group 1 of splitter group 1 to maxValue * 0.7
script-editor.applescript
end showLogs
script-editor.applescript
on getContents()
script-editor.applescript
contents of document of my theWindow
script-editor.applescript
end getContents
script-editor.applescript
on setContents(newText as text)
script-editor.applescript
set contents of document of my theWindow to newText
script-editor.applescript
end setContents
script-editor.applescript
on getScriptName()
script-editor.applescript
name of theWindow
script-editor.applescript
end getScriptName
script-editor.applescript
on getBaseScriptName()
script-editor.applescript
set winName to getScriptName()
script-editor.applescript
set endIdx to (textUtil's lastIndexOf(winName, ".")) - 1
script-editor.applescript
text 1 thru endIdx of winName
script-editor.applescript
end getBaseScriptName
script-editor.applescript
on getResourcePath()
script-editor.applescript
set projectSubPath to "applescript-core/"
script-editor.applescript
set resourcePath to path of document of theWindow
script-editor.applescript
text ((offset of projectSubPath in resourcePath) + (length of projectSubPath)) thru -1 of resourcePath
script-editor.applescript
on getDetail()
script-editor.applescript
set frontDoc to document of theWindow
script-editor.applescript
set projectSubPath to "applescript/"
script-editor.applescript
set theResourcePath to text ((offset of projectSubPath in resourcePath) + (length of projectSubPath)) thru -1 of resourcePath
script-editor.applescript
{posixPath:path of document of theWindow, name:name of document of theWindow, resourcePath:theResourcePath}
script-editor.applescript
end getDetail
script-editor.applescript
on saveAsText(targetFolder)
script-editor.applescript
set newScriptName to textUtil's replace(getScriptName(), ".scpt", ".applescript")
script-editor.applescript
logger's debug("New Script Name: " & newScriptName)
script-editor.applescript
tell document of my theWindow
script-editor.applescript
save as "text" in targetFolder & newScriptName
script-editor.applescript
end saveAsText
script-editor.applescript
on saveAsScript(targetFolder)
script-editor.applescript
set newScriptName to textUtil's replace(getScriptName(), ".applescript", ".scpt")
script-editor.applescript
save as "script" in targetFolder & newScriptName
script-editor.applescript
end saveAsScript
script-editor.applescript
on saveAsStayOpenApp(targetFolder)
script-editor.applescript
set newScriptName to textUtil's replace(getScriptName(), ".applescript", ".app")
script-editor.applescript
save as "application" in targetFolder & newScriptName with stay open
script-editor.applescript
newScriptName
script-editor.applescript
end saveAsStayOpenApp
script-editor.applescript
tell application "Script Editor" to close theWindow
script-editor.applescript
on saveDocument()
script-editor.applescript
save document of my theWindow
script-editor.applescript
end saveDocument
script-editor.applescript
on hasSavePrompt()
script-editor.applescript
button "Revert" of sheet 1 of window (name of my theWindow) exists
script-editor.applescript
end hasSavePrompt
script-editor.applescript
on respondRevert()
script-editor.applescript
click button "Revert" of sheet 1 of window (name of my theWindow)
script-editor.applescript
end respondRevert
script-editor.applescript
on compileDocument()
script-editor.applescript
compile document of my theWindow
script-editor.applescript
end compileDocument
script-editor.applescript
set posixPath to path of document of theWindow
script-editor.applescript
if my suffixedName is not missing value then -- Means it has been exported as workaround to assistive access bug.
script-editor.applescript
set posixPath to textUtil's replace(posixPath, getBaseScriptName(), my suffixedName)
script-editor.applescript
set posixPath to text 1 thru -(length of "plescript") of posixPath -- considered the off by one bug.
script-editor.applescript
posixPath
script-editor.applescript
on getScriptLocation()
script-editor.applescript
tell application "Script Editor" -- Wrapped due to error, was fine before.
script-editor.applescript