23 October 2021, 20:58 | #1 |
Registered User
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
|
Make icons that executes a cli script.
Hi all!
I hope this is the right subforum for this. I have tried to look up how to do it but maby someone can help me out when this seems like an easy thing to do. I have an A600 with the A608Mini 8mb fast ram. To be able to use the pcmcia port i have to switch it to 4mb mode by opening up a new shell and type: Code:
a608mcfg pcmciainv on Code:
a608mcfg pcmciainv off My question is if there is someone who could show me how to make an icon for each of these commands. It seems like it is possible to make two icons and just doubleklick one of them and then reboot to change the mode. Any help would be appreciated. |
23 October 2021, 21:08 | #2 |
Registered User
Join Date: Jul 2008
Location: Boston, MA
Posts: 943
|
What you’re looking for is a shell script. Just save each command in a plain text file, give each file an icon (project type) and set the default tool to IconX.
|
23 October 2021, 21:25 | #3 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
You can also run a text file from an icon without other tools like IconX, you just need to add the "S" flag to the file.
After that you can assign to this script any "executable" icon. Basically it will behave like the .bat file on Windows PCs. |
23 October 2021, 22:01 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
|
23 October 2021, 22:08 | #5 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
Yes very true Thomas, it was just to add an extra info maybe useful for the more experienced who did not know this quick procedure.
|
23 October 2021, 22:34 | #6 |
Registered User
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
|
Thank you for your help. I will try that.
|
24 October 2021, 11:51 | #7 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Maybe you want only one script that uses RequestChoice to ask 4MB, 8MB, Cancel. The script could also contain the reset command for an automatic reset. Or without asking just swap the condition (boolean).
|
24 October 2021, 12:03 | #8 |
Registered User
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
|
That sounds exactly like something i would want but my skills are not enough to even know where to start. Is there a way to request something like this?
|
24 October 2021, 13:40 | #9 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
For RequestChoice check out your AmigaDOS manual or online (for OS4) https://wiki.amigaos.net/wiki/AmigaO...#REQUESTCHOICE (you can use the example as a template)
Or like this (not tested but should work): Code:
set myresult 'RequestChoice "New Title" "This is my requester.*nSelect a gadget." "_4MB" "_8MB" "_Cancel"' IF $myresult EQ 1 a608mcfg pcmciainv on ENDIF IF $myresult EQ 2 a608mcfg pcmciainv off ENDIF IF $myresult EQ 0 echo "cancel" exit ENDIF ; In case you want a reset add it here: reset ; chose your favourite reset tool |
24 October 2021, 17:24 | #10 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,856
|
|
24 October 2021, 17:45 | #11 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Yes, but what is with all the other Amiga programs that can edit/save icons. Do they all care about protection bits? I know that for text files you can easily lose the s bit when the texteditor doesn't care.
|
24 October 2021, 18:40 | #12 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,856
|
This, I don't know.
I use ed as main text editor and never had any issue on this side so far. |
24 October 2021, 19:01 | #13 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
Also to me the Text Editors I use "don't touch" and save with the "S" flag.
Even from WinUAE if you copy a file with fag "S" to a Windows folder the "S" flag will be kept ! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I make a .bat script runnable from the desktop? | Foebane | support.Apps | 21 | 16 September 2019 19:28 |
Opening DOpus5 CLI from script? | Retrofan | support.Other | 14 | 02 August 2018 02:57 |
How to make an Workbench Icon running a CLI Script ? | Marskilla | support.Other | 9 | 26 April 2016 23:11 |
Script to find orphan folders from icons | mfilos | support.Other | 10 | 10 January 2014 17:47 |
CLI program to make mouse pointer dissapear on KS 3.X | Gaula92 | request.Apps | 5 | 21 October 2011 14:49 |
|
|