I wish to create a tool that will help me review, rename and file large numbers of pdf files generated by a document scanner. I have a working project that displays a preview of the pdf using a revbrowser control. It works but the browser has caused some issues and is not capable of previewing other file types. So I wondered if it would be possible to use the Quick Look tool that is provided as part of Mac OSX.
Before I proceed I should state that my knowledge of shell, terminal and the inner workings of my mac is quite limited.
Web research reveals that the Quick Look tool may be called using a shell script qlmanage -p filepath . I have been experimenting and have had limited success. The first problem is that the shell does not like spaces and probably other characters in the filepath. My work around is to replace spaces with back slash and space. However I am sure I should be checking for other characters. The web describes the conversion of dirty text to shell acceptable text as putting the text into the quoted form. Does anyone have a description of what characters this applies to?
My app places a list of pdf file names into a field. The user selects a file name and a preview should be displayed. My prototype preview text routine is here:
Code: Select all
On UserSelectsFile --user has clicked in the list put the selectedtext of fld "FileList" into tFilename put field "folder" & "/" & tFilename into tMyFilePath replace " " with "\ " in tMyFilePath put "qlmanage -p " & tMyFilePath into tscript put shell (tscript) into tResult end UserSelectsFile
Have any of you experience and advice of using Apple Quick Look in this way?