English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 04 May 2020, 13:25   #1
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 351
File request within script

Is there any way I can get a file requester to pop half way through a script and ask the user to choose a file (an iso file in this instance). Then have my script act on the chosen file?
gazj82 is offline  
Old 04 May 2020, 13:42   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,534
https://wiki.amigaos.net/wiki/AmigaO...ce#REQUESTFILE is what you need.
daxb is offline  
Old 04 May 2020, 15:51   #3
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 351
Thanks daxb.


It defintely looks like it is what I need. I just cant seem to get it to work. I can't seem to get it to work with simcd32 command. I have posted my script below. (it is an adaptation of someone else script)



Code:
; This is a sample floppy startup-sequence which will boot your system into
; an envirnoment similiar to the one found on the AmigaCD32. There are six
; steps involved:
;
; 1> Run the SimCD32Env program.
; 2> Run the SimCD32 program.
; 3> Mount cd0:.
; 4> Turn off fast memory.
; 5> Assign everything over to cd0:.
; 6> execute the cd0:s/startup-sequence


.bra {
.key }

assign env: ram:

REQUESTFILE >env:isofile DRAWER DH1:iso TITLE "Pick an iso to boot" NOICONS

c:SimCD32env                ; Fire up the Simulated CD32 envirnoment for SimCD32.
                            ; Preloads libraries, sets ChipRev, and opens up a 
                            ; simulated startup animation. You could add the
                            ; CDTV.TM keyword to boot up without AA enabled
                            ; (to simulate booting a CDTV trademarked disk).
                            ; This requires the presence of the simulated
                            ; freeanim.library in the library search path.


; Point SimCD32 to your ISOimage
run >nil: <nil: c:SimCD32 $isofile

Mount cd0: FROM Devs:SimCD32_Mountlist

run >Nil: <Nil: c:NoFastMem  ; The CD32 has NO fast memory.
c:Wait 1                     ; Wait to let NoFastMem take effect.

assign libs: dh0:libs       ; Gives us NVRAM capabilities (see df0:libs)
assign ENVARC: dh0:prefs/Env-Archive ; Gives NVRAM location df0:saves
makedir RAM:T
assign T: RAM:T
assign sys: cd0:            ; Assign everything over to CD0:
assign s: sys:s
assign c: sys:c
sys:
execute cd0:s/startup-sequence

endcli >nil:
gazj82 is offline  
Old 04 May 2020, 18:35   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,534
If you want to get a file then you should leave the DRAWER argument.
daxb is offline  
Old 04 May 2020, 20:08   #5
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,003
Quote:
Originally Posted by daxb View Post
If you want to get a file then you should leave the DRAWER argument.
That's not right. The DRAWER argument fills the Drawer gadget. What you mean is DRAWERSONLY.

Quote:
I just cant seem to get it to work.
>NIL: is your enemy. I guess there is an error message, but you throw it away.

.key is wrong. The directives are .bra (opening bracket) and .ket (closing bracket).
.key is required also, but as first and with a proper DOS template. .bra and .ket do not make sense without .key. And .key does not make sense if you don't take any arguments, so you should leave them all away.

Last edited by thomas; 04 May 2020 at 20:13.
thomas is offline  
Old 04 May 2020, 23:49   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,534
Ups, I did a test here and chose an empty drawer what lead me to the wrong assumption.
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use file requestor from script Sim085 support.Apps 8 30 January 2019 18:35
Will my script's .info file remember where the icon is? Foebane support.Apps 4 10 May 2018 00:52
Math Script 3.2 Key file emufan support.Apps 2 31 March 2016 14:32
Executable script file/arguments shrub3056 support.Apps 1 26 July 2011 18:08
AmigaDos script file help. T_hairy_bootson support.Apps 0 07 March 2006 10:15

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07023 seconds with 14 queries