Author Topic: Launching an external program  (Read 10273 times)

AnonymousPostings

  • Newbie
  • *
  • Posts: 49
Launching an external program
« 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?
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 464
  • Here to help you
Re: Launching an external program
« Reply #1 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.
« Last Edit: November 21, 2015, 09:25:00 AM by tigabyte »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.