AppleScript vs VBScript

Trevor DeVore lists at mangomultimedia.com
Wed Feb 3 09:23:37 EST 2016


On Wed, Feb 3, 2016 at 5:08 AM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

>
> Searching the List for VBScript examples I see nowhere where a global
> 'result' variable is defined but a simple test if LC's 'the result'
> contains "error".
>

Here is a VBScript I have used in the past that sets the <result> so that
the value is returned to LiveCode.

==================
dim theSubError
dim theProcesses

On Error Resume Next

'grabs the full process list and puts it in a var
if Err.Number = 0 then
set objService = getobject("winmgmts:")
for each Process in objService.InstancesOf("Win32_process")
theProcesses = theProcesses & Process.Name & vbLf
Next
end if


if Err.Number <> 0 then
result = Err.Number & ": " & Err.Description
else
result = theProcesses
end if
==================

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com    -    www.clarify-it.com



More information about the use-livecode mailing list