I have this (using DBlib):
Code: Select all
put field "fldFile" into myRecord["fldFile"]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
put field "fldFile" into myRecord["fldFile"]
Code: Select all
on mouseUp
launch the selectedText of field "fldFile"
end mouseUp
Code: Select all
on mouseUp
put the selectedText of field "fldFile" into tFile
launch document tFile
end mouseUp
Code: Select all
on mouseUp
launch document field "fldFile"
end mouseUp
OK, you should check the result to get a hint on what might go wrong:shawnblc wrote:Then changed to your code above. I get the same result, which isn't opening the PDF file, but no error,Code: Select all
on mouseUp launch document field "fldFile" end mouseUp
it's opening the folder where my LC project is saved. I'm still working on it and reading.
Code: Select all
...
launch document (field "fldFile")
if the result <> EMPTY then
answer "Error:" && the result
end if
...
Code: Select all
on mouseUp
launch document "/Users/Shawn/Dropbox/myPDF.pdf"
end mouseUp
Code: Select all
on mouseUp
put the selectedText of field "fldFile" into tFile
launch document tFIle
end mouseUp
OR
on mouseUp
launch document field "fldFile"
end mouseUp
Code: Select all
on mouseUp
launch document "/Users/Shawn/Dropbox/Apple Store.pdf"
end mouseUp
So this is in fact a problem of pulling the correct data out of your datagrid!I get fldFile and False
In the data grid on mouseUp. I have hilited box ticked in the properties.Klaus wrote:AHA, Datagrid!
OK, we are getting nearer:So this is in fact a problem of pulling the correct data out of your datagrid!I get fldFile and False
Where did you put the "mouseup" script? In the group script?
Code: Select all
on mouseup
## Get the selected index/line:
put the dgHilitedindex of me into pHilitedIndex
## Get the array for the selected "row":
put the dgDataOfIndex[pHilitedIndex] of me into theDataA
## get the key assocciated with your field "fldFile":
put theDataA["fldFile"] into tFile
if there is a file tFile then
launch document tFile
else
answer "File missing:" & CR & tFile
end if
end mouseup