Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
97 user(s) are online (87 user(s) are browsing Forums)

Members: 1
Guests: 96

skynet, more...

Support us!

Headlines

 
  Register To Post  

Argument for the shell and rexx script
Just popping in
Just popping in


See User information
Hi everyone

I use Backup for my backups, so I use Backup.rexx. At the end of the backup, a shell window opens to show if there were any errors, the time, etc.

In the Backup.rexx file, there are arguments for this shell window that end with "Wait". What argument can I use to tell it to close after 5 or 10 seconds?

I wrote a small script to add a function to the context menu to move files or folders directly to the Recycle Bin. The script works as expected, but a shell window opens to show the files being moved.

This shell window opens in the top left corner, and I'd like to have it in the center of the screen or somewhere other than the corner, and also have it close automatically after a certain time.

Thanks for your help.

Go to top
Re: Argument for the shell and rexx script
Not too shy to talk
Not too shy to talk


See User information
The syntax for DOS windows is CON:x/y/w/h/title/AUTO/CLOSE/WAIT

see also https://wiki.amigaos.net/wiki/AmigaDOS_Device_Input_and_Output#CON:

/AUTO opens the window only if there is any output.
/CLOSE adds a close gadget to the window
The combination of /AUTO/CLOSE allows the user to close the window at any time. It will open again when there is more output.
/WAIT waits at the end of the script until the user closes the window. Without /WAIT the window disappears immediately when the script ends.

There is no time option. You can only trick it. Which means you can remove /WAIT from the window spec and add a wait instruction to the end of your script.

In the same way x/y/w/h are always absolute coordinates. There is no way to open the window relative to the screen size. All you can do is to adjust the coordinates to your preferred screen size.

Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
Hi Thomas,

I saw that you also wrote to me on OS4Welt, thank you so much!

I'll write here instead, since I'm writing in French and using Google Translate. The English translation is more understandable than the German one, I think?

After several attempts, I can't get it to work the way I want.

I've opted for a more practical solution.

In the context menu, I added a line to allow me to move or delete a file, a drawer, or multiple files or folders, etc.

Speaking of the context menu, is it possible to make text bold?

It's a query option that gives me the choice of moving the item to the trash or deleting it.

Yes, I did something stupid the other day!

I was editing a VideoVortex favorites file with 35 entries, I saved it, and then I thought, "I can delete some of these files because I don't need them anymore!"

And I deleted the file I had just saved with my 35 entries #¿?!!# Idiot!

Now I have another problem: I'd like to get "the name of the element I'm moving or deleting" in my query.

I've tried several things, but none of them do what I want.

If I'm not mistaken, there's "the title," "the body," "the choice," and I'd like the body to tell me the element I'm deleting.

I've done several searches using AI and reading, but nothing works.

Does anyone have a solution?

Thanks for your help!

I have one more thing to try; I'll see if I can get what I want!

Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
@skynet
Quote:
skynet wrote:Hi Thomas,

In the context menu, I added a line to allow me to move or delete a file, a drawer, or multiple files or folders, etc.


Isn't such a line already in the contextmenues? Here there is an entry, I am pretty sure it is default.

Quote:
Speaking of the context menu, is it possible to make text bold?

I couldn't find anything in the Documentation

Quote:
It's a query option that gives me the choice of moving the item to the trash or deleting it.

nice idea!

Quote:

Yes, I did something stupid the other day!

I was editing a VideoVortex favorites file with 35 entries, I saved it, and then I thought, "I can delete some of these files because I don't need them anymore!"

And I deleted the file I had just saved with my 35 entries #¿?!!# Idiot!

if your Storage device is formatted in SFS, there might be a hidden ".recycled" folder in the root directory of the disk. You might be able to salvage your files!
Open a Shell and

9.AmigaOS4:>dir VolumeName:.recycled

the files might have other characters attached at the end, e.g. VideoVortexFavourites.1$ABC
then copy the file to RAM:
9.AmigaOS4:>copy clone VolumeName:.recycled/FileName to RAM:



Quote:

Now I have another problem: I'd like to get "the name of the element I'm moving or deleting" in my query.


In the documentation under "Special arguments" I found some arguments which may help. Look for:
%s, %n, %o, %O, %f
Maybe there is something you use for your purpose.

Quote:

If I'm not mistaken, there's "the title," "the body," "the choice," and I'd like the body to tell me the element I'm deleting.

I am not sure I understand.
I don't think it is dynamically possible to change a ContextMenu entry.
i.e. I don't think one can right click on a file RAM:Testfile1.txt and then the Context menu shows "Delete TestFile1.txt! right in the menu and that it changes the menu entry accordingly to the file name.
But someone might know better.

That could be worth an entry to the Thread " minor features for AmigaOS 4.2" by tao!
Amigans.net Minor feature suggestions for AmigaOS 4.2

Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
@Tuvok
Quote:
Isn't such a line already in the contextmenues? Here there is an entry, I am pretty sure it is default.


Yes, just erase!
That's a dangerous trick!

I had to rebuild it using the small icons (tbimages).

And the "move to trash" function isn't included in my context menu?

Quote:
Regarding the context menu, is it possible to make text bold?
I couldn't find anything about it in the documentation.


Me neither.

Quote:
if your Storage device is formatted in SFS, there might be a hidden ".recycled" folder in the root directory of the disk. You might be able to salvage your files!
Open a Shell and


No, my partitions are in NGFS.

Quote:
In the documentation under "Special arguments" I found some arguments which may help. Look for:
%s, %n, %o, %O, %f
Maybe there is something you use for your purpose.


I'll go see. (The only argument that works well is %f, with my script.)

Quote:
If I'm not mistaken, there's "the title," "the body," "the choice," and I'd like the body to tell me the element I'm deleting.


In my "requestchoice" script

Thank you for your help!


Edited by skynet on 2026/4/4 12:37:17
Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
But isn't there a script or something similar that would simply display the name of the selected file in a requester window?

I think there's a way to add it to my script?

My goal is to indicate what is being deleted or moved, even when it's selected.

Go to top
Re: Argument for the shell and rexx script
Not too shy to talk
Not too shy to talk


See User information
@skynet

Hi skynet,

I'm curious - you're backing up what from where to where?

It sounds like you are mixing up CLI scripts with ARexx scripts.

In my experience, anytime I start needing to be building
requesters (requestchoice, requeststring, etc), keeping track of
data and interacting with the a user, then it almost always is
better to just write the whole thing in ARexx.

Call any command line things using "address command +LINE"
and read/deal with any redirected output or errors from within
the ARexx script.

Maybe it would be better to describe more exactly what you are
trying to do?

Thanks,

PJS

Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
@pjs

Hi Pyjamas,

Since there's only one function in the context menu to get rid of a file or anything else, "delete,"

the other day I accidentally deleted a file I had just modified and saved (a favorites list) so I could use it in VideoVortex. I thought it would be nice to add a function below the "delete" function in the context menu so that instead of deleting it, it would be moved to the trash.

I've reinstalled the trash on my SSD (NGFS).

What I'd like now is to be able to replace "Place in the trash or erase?"

with "Place [the name of the item to delete] in the trash or erase?"

To be more specific about the item being deleted.

Here's the script I use to move a file or anything else to the trash.


Setenv choice `RequestChoice "Trash / Delete?" "place in the trash or erase?" "place in the trash|erase|Cancel"`
If 
$Choice eq "0" 
Endif
If 
$Choice eq "1"
.key FILE/A
Move 
"<FILE>" "HD0:Trashcan"
Move "<FILE>.info" "HD0:Trashcan"
EndIf
If 
$Choice eq "2" 
delete "<FILE>"
Endif

Go to top
Re: Argument for the shell and rexx script
Not too shy to talk
Not too shy to talk


See User information
Quote:
skynet wrote:

What I'd like now is to be able to replace "Place in the trash or erase?"

with "Place [the name of the item to delete] in the trash or erase?"

To be more specific about the item being deleted.


You can use the same substitution as you use in the Move and Delete commands. Just use <FILE> where you want to see the file name.

Go to top
Re: Argument for the shell and rexx script
Just popping in
Just popping in


See User information
Already tried that.

To clarify, it's in the requestchoice section after "Trash / Delete?" to replace "place in the trash or erase?"

With: "Place <FILE> in the trash or erase"

Or is that not possible?

Go to top
Re: Argument for the shell and rexx script
Not too shy to talk
Not too shy to talk


See User information
@skynet

Have you tried NGFCheck on CLI? I can't find much info about it. According to online talk that can work as a recovery tool.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 1 members and 1 Anonymous Users )
skynet  



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1 12% (26)
Pegasos2 3% (8)
X5000 22% (48)
X1000 14% (30)
A1222 8% (19)
Sam 440/460 18% (40)
Classic PowerPC Amiga 2% (6)
WinUAE emulation 7% (16)
Qemu emulation 9% (21)
Total Votes: 214
The poll closed at 2025/12/1 12:00
8 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project