newbieQ: How to launch an external application from Rebol ?
[1/12] from: jasonic:panix at: 28-Sep-2001 13:37
arggh: {help, I must be very dumb today}
How the !@#$! do you run a .exe file or open a .swf [Flash] on win32 from
Rebol Rebol/view [or Rebol/Command] ?
I want to have Flash interfaces access Rebol.
I can do this when they are embedded in HTML, by using the URL, but I want
to avoid web browsers and just open .swf or .exe [selfcontained projecter
versions].
ditto mac/linux equivalents ?
Thanks
- Jason
[2/12] from: greggirwin:starband at: 28-Sep-2001 11:46
Hi Jason,
I think what you want is the 'call function. I believe you need View/Pro or
Command for that.
--Gregg
[3/12] from: jasonic:panix at: 28-Sep-2001 14:25
> I think what you want is the 'call function. I believe you need View/Pro
or
> Command for that.
Gregg
Yes thanks..I am using Command.
After repeat tries, it suddenly started working -> the problem seems to be
with my machine. The Rebol console is behaving very strangely [maximize
minimize not working]. Win32 friday tantrums I suspect.
>>> call "rebol_flash.exe"
works ok but it flashes the ultra-annoying black MSDOS window for a couple
of seconds before the Flash standalone executable launches. This is *not*
acceptable. Anyone know how to avoid this? There must be a better way.
worse, when I try
>>> call "rebol_flash.swf"
It does not work. This is disappointing.
How to have Rebol to substitute for typical user clicking on a windows
filetype [registered to launch via an application, in this case the
installed FlashPlayer]
- Jason
[4/12] from: greggirwin:starband at: 28-Sep-2001 13:22
Jason,
The Shell Interface docs list a number of refinements, though nothing jumped
out at me for your issue.
Have you tried changing the file extension from "swf" to "exe" to see if
that does the trick?
--Gregg
[5/12] from: jasonic:panix at: 28-Sep-2001 16:30
> Have you tried changing the file extension from "swf" to "exe" to see if
> that does the trick?
>
> --Gregg
thanks. tried it. Didn't work.
I would not want it to either - it would wreak havoc with the Flash
publishing scheme.
ie: you create and edit source content in the native .FLA format. Then
select a number fomrats to export under: HTML, SWF, JPG, QUICKTIME etc. Edit
the default templates and prefs for each iof these media, then issue a
single 'Publish' command and simultaneous versions are rendered. This is
grest for workflow becuae you stay inside the authoring tool [Flash5] and
just keep banging the hot keys CTRL+S: SAVE and SHIFT+F12: PUBLISH to test
and improve the project.
Ironically, I can easily do what IU want in the other direction: launch
rebol from a standalone Flash5 excutable. Thre are also some excellent 3rd
party add-ons increasing the feature set. Best of them for Win32 appears to
be SWFStudio:
http://www.northcode.com/studio/ $139
http://www.northcode.com/studio/features/index.html
Now looking into this as a viable way to install and launch rebol from
seamless Flash interface.
Both the platforms are very small, and minimally may even fit on a single
floppy together.
- Jason
[6/12] from: matt:blis at: 28-Sep-2001 21:52
What you'd need to do is launch the flash player and pass the filename
of the movie as an argument.
E.g. "C:\PROGRAM FILES\MACROMEDIA\FLASH 5\PLAYERS\FLASHPLA.EXE
c:\myfiles\mymovie.swf"
Matt
> > Have you tried changing the file extension from "swf" to
> "exe" to see
<<quoted lines omitted: 16>>
> Thre are also some excellent 3rd party add-ons increasing the
> feature set. Best of them for Win32 appears to be SWFStudio:
http://www.northcode.com/studio/ $139
http://www.northcode.com/studio/features/index.html
Now looking into this as a viable way to install and launch rebol from
seamless Flash interface. Both the platforms are very small, and
minimally may even fit on a single floppy together.
- Jason
[7/12] from: jasonic:panix at: 28-Sep-2001 17:26
> What you'd need to do is launch the flash player and pass the filename
> of the movie as an argument.
>
> E.g. "C:\PROGRAM FILES\MACROMEDIA\FLASH 5\PLAYERS\FLASHPLA.EXE
> c:\myfiles\mymovie.swf"
>
> Matt
Thanks Matt : nice try, and getting closer: yes it _does_ launch the .SWF
:-)
But like the .EXE it still blips the damned black MSDOS window for a
disturbing moment.
Am I the only person who would like to use Rebol to launch Win32 apps
cleanly ?
- Jason
[8/12] from: greggirwin:starband at: 28-Sep-2001 17:07
<< Am I the only person who would like to use Rebol to launch Win32 apps
cleanly ? >>
Surely not. I think the question is, can RT give us what we want while
maintaining portability? In any case, try the attached code and see if it
works for you. I didn't take time to define enums or anything but I'd be
interested to hear if it eliminates your problem.
--Gregg
REBOL []
win-user: load/library %shell32.dll
win-shell: context [
execute: make routine! [
hwndParent [integer!]
Operation [string!]
File [string!]
Parameters [string!]
Directory [string!]
ShowCmd [integer!]
return: [integer]
] win-user "ShellExecuteA"
; Operation values
; "open"
; "print"
; "explore"
; ShowCmd values
; 0 Hides the window and passes activation to another window.
;
; 1 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 9).
;
; 2 Activates a window and displays it as an icon.
;
; 3 Activates a window and displays it as a maximized window.
;
; 4 Displays a window in its most recent size and position. The
; window that is currently active remains active.
;
; 5 Activates a window and displays it in its current size and
; position.
;
; 6 Minimizes the specified window and activates the top-level
; window in the system's list.
;
; 7 Displays a window as an icon. The window that is currently
; active remains active.
;
; 8 Displays a window in its current state. The window that is
; currently active remains active.
;
; 9 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 1).
]
win-shell/execute 0 "open" "notepad.exe" "" "" 1
win-shell/execute 0 "open" "calc.exe" "" "" 1
[9/12] from: jasonic:panix at: 28-Sep-2001 20:26
Gregg
YES!! Thank you very much for this..
win-shell/execute 0 "open" "c:\rebol\local\rebol_flash.exe" "" "" 1
btw, do you know what the miminum Rebol will work for is -> View Pro ?
-Jason
----- Original Message -----
From: "Gregg Irwin" <[greggirwin--starband--net]>
To: <[rebol-list--rebol--com]>
Sent: Friday, September 28, 2001 4:07 PM
Subject: [REBOL] Re: newbieQ: How to launch an external application from
Rebol ?
[10/12] from: deadzaphod:flyingparty at: 28-Sep-2001 18:09
> worse, when I try
>
> >>> call "rebol_flash.swf"
>
> It does not work. This is disappointing.
> How to have Rebol to substitute for typical user clicking on a windows
> filetype [registered to launch via an application, in this case the
> installed FlashPlayer]
I think what you need for this is the windows "start" command, which can
deal with windows filetypes.
try this:
call "start rebol_flash.swf"
I haven't done much with the shell features of view/pro yet, but I think the
solution with DLL calls is the only way to avoid the black DOS box popping
up (at least with the current version of rebol).
-Cal
[11/12] from: greggirwin::starband::net at: 28-Sep-2001 20:26
Hi Jason,
<< YES!! Thank you very much for this.. >>
Glad it worked!
<< btw, do you know what the miminum Rebol will work for is -> View Pro ? >>
I belive so.
Here is a cleaned up version. I patched it together quickly and it had
some warts. This one puts the library word inside the context and gives
it a better name. (I couldn't remember if ShellExecute was in User or
Shell and I forgot to change the word)
--Gregg
REBOL []
win-shell: context [
win-lib: load/library %shell32.dll
execute: make routine! [
hwndParent [integer!]
Operation [string!]
File [string!]
Parameters [string!]
Directory [string!]
ShowCmd [integer!]
return: [integer!]
] win-lib "ShellExecuteA"
; Operation values
; "open"
; "print"
; "explore"
; ShowCmd values
; 0 Hides the window and passes activation to another window.
;
; 1 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 9).
;
; 2 Activates a window and displays it as an icon.
;
; 3 Activates a window and displays it as a maximized window.
;
; 4 Displays a window in its most recent size and position. The
; window that is currently active remains active.
;
; 5 Activates a window and displays it in its current size and
; position.
;
; 6 Minimizes the specified window and activates the top-level
; window in the system's list.
;
; 7 Displays a window as an icon. The window that is currently
; active remains active.
;
; 8 Displays a window in its current state. The window that is
; currently active remains active.
;
; 9 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 1).
]
win-shell/execute 0 "open" "notepad.exe" "" "" 1
win-shell/execute 0 "open" "calc.exe" "" "" 1
[12/12] from: jasonic:panix at: 28-Sep-2001 23:22
> I think what you need for this is the windows "start" command, which can
> deal with windows filetypes.
> try this:
>
> call "start rebol_flash.swf"
>
> I haven't done much with the shell features of view/pro yet, but I think
the
> solution with DLL calls is the only way to avoid the black DOS box popping
> up (at least with the current version of rebol).
>
> -Cal
Yes this works
>>> call "start c:\rebol\local\rebol_flash.swf"
But still with the black DOS box.
Look like until Rebol integrates this more deeply, Gregg's solution is the
way to go
Thanks everyone
- Jason
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted