HyperNext Studio

HyperNext Studio => Files => Topic started by: AnonymousPostings on July 13, 2010, 10:48:35 AM

Title: Launching an external program
Post by: AnonymousPostings on July 13, 2010, 10:48:35 AM
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?
Title: Re: Launching an external program
Post by: Malkom on July 13, 2010, 10:51:30 AM
You can use the FolderItemLaunch command to launch an external program both under OS X and Windows platforms

Code: [Select]
FolderItemLaunch fhandle,value
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: [Select]
  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


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