Re: do visual basic
Re: do visual basic
- Subject: Re: do visual basic
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 10 Mar 2004 09:26:21 -0800
Don't assume. Try it.
The result of 'do Visual Basic' is not the VB result, And 'Return x' is not
a VB statement anyway. If you try what you suggested:
tell application "Microsoft Word"
set X to do Visual Basic "
dim x as string
x = 10
Return x
"
display dialog X
end tell
VB Editor opens with a big error message "Compile error. Syntax error" and a
TempDDE() subroutine highlighting 'Return x'. Then a minute later you get an
AppleEvent timed out in Script Editor. Similarly, if you remove 'Return'.
--
Paul Berkowitz
>
From: Andrew Oliver <email@hidden>
>
Date: Wed, 10 Mar 2004 09:08:56 -0800
>
To: Giampiero Cairo <email@hidden>, <email@hidden>
>
Subject: Re: do visual basic
>
>
There is no association between the variable named 'x' inside the Visual
>
Basic script and the variable named 'x' in the AppleScript.
>
>
I've never used VB scripting within AppleScript, but I would assume you can
>
assign the result of the VB Script to an AppleScript object to achieve what
>
you're after:
>
>
set x to Do Visual Basic"
>
dim x as string
>
x = 10
>
Return x
>
"
>
>
display dialog x
>
>
In this example the return value of the VB script is put into the
>
AppleScript variable x. The similar names are pure coincidence.
>
>
Andrew
>
:)
>
>
On 3/10/04 8:08 AM, "Giampiero Cairo" <email@hidden> wrote:
>
>
> Hi all,
>
>
>
> I use applescript and in particular the command "Do Visual Basic"
>
>
>
> I want to get a value of a variable from the routine of Visual basic to the
>
> rest of applescript code.
>
>
>
>
>
> this is my snippet of script:
>
>
>
>
>
> set myvar to ""
>
>
>
> Do Visual Basic "
>
> dim x as string
>
> x = 10
>
> Return x
>
> "
>
>
>
> repeat with x from 1 to 10
>
> set AnotherVar to x + 1
>
> end repeat
>
>
>
>
>
> Is it correct if I would pass the x value to the rest of my script for
>
> example to the "repeat cicle"?
>
>
>
>
>
>
>
> TIA
>
>
>
> Giampiero
>
> _______________________________________________
>
> applescript-users mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.