Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Screen Saver Wizard
Follow me
Random numbers from file names -w/ BuddyAPI
Blur Button-Alphamania
SpaceShooter
Datagrip
3D controller example
Read a File
Amara Flash News Ticker
Text Drop Shadows (and a moving light)
MediaMacros Xtras Mall
 

 

 

Behavior Open File with associated extension.

Added on 10/2/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: MediaMacros (website)

Use on a button to open a file with its associated application. User must have the application installed. Select the full pathname. If relative path is checked then the path will be in relationship to the current director movie file, as if you were adding it to the moviePath command.

property fileToOpen, relative, dialog

on getPropertyDescriptionList me
  set p_list = [#fileToOpen: [#format : #string, #comment : "File to open-Including path and extension:", #default:""], #relative : [#format : #boolean, #comment : "Relative path to projector?", #default : true], #dialog : [#format : #boolean, #comment : "Give dialog if program not found?", #default : true]]
  return p_list
end

on mouseUp me
    if relative = true then
    myFile = the moviePath & fileToOpen
  else
    myFile = fileToOpen
  end if
  myFile = baShortFileName(myFile)  
  if baFileExists(myFile) = 1 then
    howMany = fileToOpen.char.count
    extension = fileToOpen.char[(howMany - 2)..howMany]
    prog = baFindApp( extension)
    if prog = "" then
      findIt = baMsgBox("No program was found that is associated with this type of file.  Would you lik to browse for it yourself?", "Find the program yourself?", "YesNo", "Question", 1)
      if findIt = "Yes" then
        prog = baGetFilename( "Open", "c:", "*.exe;*.com;*.bat", "Program Files|*.exe;*.com;*.bat", 0, "Find associated program.", false, -1, 0 )
        baRunProgram( baShortFilename( prog ) && myFile , "maximised", true)
      else    
        exit
      end if
    else        
      baOpenFile(myFile , "maximised")        
    end if
  else
    alert "File" && fileToOpen && "doesn"t exist."
  end if
end


on getBehaviorDescription me
  describe = "Use on a button to open a file with its associated application.  User must have the application installed." & return & "Select the full pathname.  If relative path is checked then the path will be in relationship to the current director movie file, as if you were adding it to the moviePath command."
  return describe
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail