HyperNext Studio > Files

Launching an external program


Is there a way to script a button or some other object to run an outside program for example Photoshop or Windows Media Center. I intent to use HyperNext to create a more visually pleasing method for opening programs on my computer?

You can use the FolderItemLaunch command to launch an external program both under OS X and Windows platforms

--- Code: ---FolderItemLaunch fhandle,value
--- End code ---

This command launches the application specified by the given file handle. If value is zero then the application will run in the background, and if non zero will run in the foreground.

Place the following script in a button to launch a file called Photoshop.exe in the given directory:-

--- Code: ---  Local fname,fhandle,fdetails,ftypes, fpaths,fnames,fextens

  @ set the filename of the program to launch
  Put 'C:ProgramFiles\Adobe\AdobePhotoshop.exe' into fname

  @ Get the file handle
  FolderItemGetAbs(fname,fhandle,fdetails,ftypes, fpaths,fnames,fextens)

  @ Launch the application in the foreground
  FolderItemLaunch fhandle,1
--- End code ---

I'm sorry the above script looks messy but the FolderItem command is very flexible and returns so lots of info.


[0] Message Index

Go to full version