Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
1 user(s) are online (1 user(s) are browsing Forum)

Members: 0
Guests: 1

more...

Browsing this Thread:   1 Anonymous Users





Run a script with a double click

Joined:
3/3 13:00
Group:
Member
Posts: 17
Offline
Simple question, i edit a script like this:

echo "test"

and save it in a file, for example "test".

How to start it with a simple double click? Is it possible also to set title, position and size of the window?

Sorry i am new to AROS.

Posted on: 3/13 3:53
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2004/5/7 2:45
From Daoulas (Finistère, France)
Group:
Member
Posts: 644
Offline
Hi Pasquale, don't be sorry
You need to use Wanderer (or any Workbench clone ofc) to go in the drawer where your script is saved, then select its "test" icon and use the right-clic menu to open Icon/Information...

In this Information window you need to change the tool, for it to be C:IconX

Now you can go to the Tooltypes tab of the Information window, and add a WINDOW tooltype like that:
WINDOW=CON:200/50/300/120/Test run by IconX/AUTO/CLOSE

This will open a Shell window with a title and dimensions as defined, and it will close it after 2 seconds. You can change this delay, either by adding WAIT or DELAY tooltypes with the delay you want (have a look here for the differences), or you can add /WAIT just after /CLOSE in the WINDOW tooltype, which will wait for the user to close the window himself.

Posted on: 3/13 4:45
_________________
Everyone knew it was impossible. Along came a fool who did not know and he did it.
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
3/3 13:00
Group:
Member
Posts: 17
Offline
Thanks, you help me to do a simple script that shows date and time, so:

echo
echo " " noline
date

i save it as "Date&Time"; then on Icon -> Information -> Tool i write:

C:IconX

then on Tooltypes:

WINDOW=CON:600/50/247/120/Date&Time
WAIT=5

Added an icon to BoingIconBar. Hope useful to someone.

Posted on: 3/13 6:59
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2012/4/16 8:41
From Brindisi (Italy)
Group:
Member
Posts: 1002
Offline
@Pasquale
A script can also be run directly as if it were an executable without the project icon support (IconX).
A script can be converted into executable by adding "S" "Protection Bits"

Posted on: 3/14 4:45
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2004/5/7 2:45
From Daoulas (Finistère, France)
Group:
Member
Posts: 644
Offline
@amiga
You're right but only when some conditions are met: on an unmodified system, the script is recognized as text, and thus gets a default project icon (a fake icon) with Multiview as default tool... So double-clicking its icon just does that: open the script with Multiview.

You're right nevertheless, you can use the Information window to delete the default tool and save, which will create a (real) project icon without a default tool: Wanderer will then fail to open it "à la Workbench", but will try to open the script "à la Shell": it will open a requester for you to confirm the command and its arguments, and then if the 'S' bit is not set, Wanderer will complain that the file is not executable. But if the 'S' bit is set, it will execute the script indeed.

Now it doesn't allow you to ask for specific dimensions/placement for the window, nor for its automatic closure.

Posted on: 3/14 7:30
_________________
Everyone knew it was impossible. Along came a fool who did not know and he did it.
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2012/4/16 8:41
From Brindisi (Italy)
Group:
Member
Posts: 1002
Offline
This happens because there is no right assignment a "def_script.info", on my AFA OS works well I created the right icon, look at my videos.

TXT To Executable



Posted on: 3/14 12:50
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2004/5/7 2:45
From Daoulas (Finistère, France)
Group:
Member
Posts: 644
Offline
@amiga
Thank you for the nice video! And congratz for the 1000 posts!

So if I understand well, your def_script.info recognizes a script when the 'S' bit is set? That's interesting, and should probably be done on AROS too indeed.

But I fail to see a script as an executable (tool), it looks like a hack? I would prefer the default icon to be a project one as expected, with C:IconX as default tool.

C:IconX has some advantages as already discussed, but on AROS it is even able to give workbench arguments to the script if this one takes arguments.

Posted on: 3/14 13:57
_________________
Everyone knew it was impossible. Along came a fool who did not know and he did it.
Transfer the post to other applications Transfer


Re: Run a script with a double click

Joined:
2012/4/16 8:41
From Brindisi (Italy)
Group:
Member
Posts: 1002
Offline
Quote:
So if I understand well, your def_script.info recognizes a script when the 'S' bit is set?

Yes, just that the default was set as an icon Project and I changed to program icon. However, you can manage the two functions, see video exhaustive:

Change script icon




Posted on: 3/14 15:31
Transfer the post to other applications Transfer






You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4208
2 magorium
magorium
4095
3 phoenixkonsole
phoenixkonsole
3877
4 nikolaos
nikolaos
3637
5 deadwood
deadwood
2921
6 ncafferkey
ncafferkey
2528
7 mazze
mazze
2199
8 clusteruk
clusteruk
2055
9 Kalamatee
Kalamatee
1960
10 damocles
damocles
1789
© 2004-2014 AROS Exec