English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 13 October 2018, 05:57   #1
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Execute script without knowing name?

Is there a way of using the Execute command with wildcards, if you don't know the name of the script and it's the only file on the selected path? I would prefer NOT to use startup-sequence or anything like that.
Foebane is offline  
Old 13 October 2018, 06:05   #2
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,767
Not sure, but thinking out loud here...
Could you redirect the output of the "dir" command into an environment variable and then execute that environment variable?
(No idea if that would work; but it's late and that popped into my head. That and an image of Betty Grable playing Turrican. Maybe you shouldn't listen to me after all...)
desiv is offline  
Old 13 October 2018, 07:12   #3
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Here is what I came up with, thanks to that old script I'd been working on concerning extraction of multiple files. I simply modified it to this:

Code:
LIST #? LFORMAT="EXECUTE *"%N*"" >RAM:Foebane
EXECUTE RAM:Foebane
It does the job, and I can use it with any single file with any name I choose.
Foebane is offline  
Old 13 October 2018, 08:52   #4
haps
Rumpig
 
haps's Avatar
 
Join Date: Aug 2006
Location: The bottom of the bottle
Age: 92
Posts: 243
What a silly idea.

While running scripts you don't know the name of, why not run scripts that you don't even know the purpose of.
haps is offline  
Old 13 October 2018, 09:42   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
This one does not nest execute commands:

Code:
execute "`list nohead quick`"
Might not work on Kick 1.3, though. But %n does not work on 1.3, either. Use %s instead.
thomas is offline  
Old 13 October 2018, 10:27   #6
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
I think OP meant "how to execute scripts with a given pattern" (some software just creates files with dates, etc... useful in that case)
jotd is offline  
Old 13 October 2018, 11:19   #7
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Another way of doing this :
Code:
s:spat execute #?
It will, however, execute all of them (but if several files match, how to choose the right one anyway ?).
meynaf is offline  
Old 13 October 2018, 15:11   #8
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Some clarification:

I wanted my AmigaDOS setup to detect any scripts found on DH4: and run them upon startup, but it would be only one script, and the configuration would point to the zip archive I was going to use that contained the DH4: data. However, I had to use the same name for the execute command, so what I wanted was to be able to execute any lone script found on DH4: with any name.

Basically, this is a carry-on from my thread about the "flickery objects" from Support.WinUAE, but it is still an interesting question, I think.

Nesting script executions is a bad thing? I think I'm already doing it with my current setup, I didn't think there'd be a problem.

I'm currently at a relative's for the weekend, so I won't be able to try out your suggestions until at least Monday morning, but any advice is still welcome.
Foebane is offline  
Old 14 October 2018, 18:42   #9
Foebane
Banned
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
Quote:
Originally Posted by meynaf View Post
Another way of doing this :
Code:
s:spat execute #?
It will, however, execute all of them (but if several files match, how to choose the right one anyway ?).
Back home now, just tried this and it works. What's more, I had a loot at the SPat script and it's almost similar to my own above. But this script already exists so I will use it instead.

Thanks, Meynaf!
Foebane 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
Execute file without using execute VoltureX support.Apps 3 01 December 2011 09:59
Execute script works but not after adding an icon with IconX as Default Tool. e5frog support.Other 19 27 July 2010 10:23
I can't execute installer paulo_becas support.Apps 5 01 March 2010 10:02
How to execute an intro with ASM ONE W4r3DeV1L Coders. General 56 14 June 2008 13:00
Execute a script frikilokooo project.ClassicWB 6 20 November 2007 11:36

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 05:00.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13249 seconds with 15 queries