# Script in button

**URL:** <https://resource.dopus.com/t/script-in-button/3916>\
**Category:** Help & Support\
**Created:** [May 31, 2007, 9:39pm UTC](https://resource.dopus.com/t/script-in-button/3916 "2007-05-31T21:39:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baghenamoth](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/c6cbf5/32.png) [@Baghenamoth](https://resource.dopus.com/u/Baghenamoth)\
**Post date:** [May 31, 2007, 9:39pm UTC](https://resource.dopus.com/t/script-in-button/3916/1 "2007-05-31T21:39:42Z")

</div>

Hi everybody,

I just try this script in a button but it doesn't work :

`@script vbscript
myPath = {filepath}
msgbox myPath
`

this one works well

`@script vbscript
myPath = "Hello"
msgbox myPath
`

can you tell me how to call arguments like {filepath},{sourcepathshort} ... which work in basic script (not called in vbscript) for example :  
"C:\Program Files\WinRAR\WinRAR.exe" e "{filepath}" "{destpath}"

Another question : is there an alternative to vbscript (like perl, autoit 😆 ) ?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [June 1, 2007, 5:59am UTC](https://resource.dopus.com/t/script-in-button/3916/2 "2007-06-01T05:59:22Z")

</div>

@script is only for use with renames at the moment. If you want to run a script as part of a normal button you have to put it in a .vbs file and call it.

There's an example of this in this thread:

[[One Hotkey for 2 commands](http://resource.dopus.com/t/one-hotkey-for-2-commands/3883/1))

---

<div class="post-metadata">

**Author:** ![Baghenamoth](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/c6cbf5/32.png) [@Baghenamoth](https://resource.dopus.com/u/Baghenamoth)\
**Post date:** [June 1, 2007, 7:23am UTC](https://resource.dopus.com/t/script-in-button/3916/3 "2007-06-01T07:23:16Z")

</div>

> [@nudel](#):
>
> you have to put it in a .vbs file and call it.

Ok I can do this, but maybe can you tell me why this is working ?

`@script vbscript
myPath = "Hello"
msgbox myPath`

Anyway, thank you for your answer.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [June 1, 2007, 7:27am UTC](https://resource.dopus.com/t/script-in-button/3916/4 "2007-06-01T07:27:06Z")

</div>

> [@Baghenamoth](#):
>
> Ok I can do this, but maybe can you tell me why this is working ?

By accident I guess. 🙂

---

<div class="post-metadata">

**Author:** ![Baghenamoth](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/c6cbf5/32.png) [@Baghenamoth](https://resource.dopus.com/u/Baghenamoth)\
**Post date:** [June 1, 2007, 7:30am UTC](https://resource.dopus.com/t/script-in-button/3916/5 "2007-06-01T07:30:05Z")

</div>

lol

---

<div class="post-metadata">

**Author:** ![rcoleman1943](https://resource.dopus.com/user_avatar/resource.dopus.com/rcoleman1943/32/38773_2.png) [@rcoleman1943](https://resource.dopus.com/u/rcoleman1943)\
**Post date:** [June 3, 2007, 1:38am UTC](https://resource.dopus.com/t/script-in-button/3916/6 "2007-06-03T01:38:42Z")

</div>

> [@Baghenamoth](#):
>
> Another question : is there an alternative to vbscript (like perl, autoit 😆 ) ?

> [@nudel](#):
>
> If you want to run a script as part of a normal button you have to put it in a .vbs file and call it.

You can also do that with Autoit (and probably Perl, but I haven't done it with Perl).

I've actually done it with Autoit and Open Object REXX.

---

<div class="post-metadata">

**Author:** ![Baghenamoth](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/c6cbf5/32.png) [@Baghenamoth](https://resource.dopus.com/u/Baghenamoth)\
**Post date:** [June 3, 2007, 10:10pm UTC](https://resource.dopus.com/t/script-in-button/3916/7 "2007-06-03T22:10:53Z")

</div>

[quote="rcoleman1943"]You can also do that with Autoit (and probably Perl, but I haven't done it with Perl).

I've actually done it with Autoit and Open Object REXX.[/quote]

As I use a lot of AutoIt script I've done the script I wanted and it works well. I just have to call it with {filepath} as argument and it rocks !

---

<div class="post-metadata">

**Author:** ![David](https://resource.dopus.com/user_avatar/resource.dopus.com/david/32/51561_2.png) [@David](https://resource.dopus.com/u/David)\
**Post date:** [June 3, 2007, 11:09pm UTC](https://resource.dopus.com/t/script-in-button/3916/8 "2007-06-03T23:09:57Z")

</div>

[quote]You can also do that with Autoit (and probably Perl, but I haven't done it with Perl).

I've actually done it with Autoit and Open Object REXX.[/quote]

Quite some time ago I made a few buttons using PHP command line scripting.

Open Object REXX looks very interesting.  
I've bookmarked it and will look into it some more when I return from my holiday in two weeks.
