|
|
|
Open File with associated extension.
Added on 10/2/2000
|
|
Compatibilities:
Required Xtras:
Buddy API
|
This item has not yet been rated
|
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
|
|