mweiss Posted March 24, 2009 Share Posted March 24, 2009 I am wondering if there is a way, probably using Applescript, to Quicklook an object (file, graphic, sound, etc.) that is stored in a container field. It seems that would be a very desirable function. Link to comment Share on other sites More sharing options...
mweiss Posted March 24, 2009 Author Share Posted March 24, 2009 I decided to try to solve my own problem and put together this rough prototype. It uses the terminal's qlmanage command to Quicklook any file, image, or Quicktime document in a container field (provided that only a reference is stored in the container). If anybody wants to improve on this so that it also works with files, etc. that are stored internally (not as reference), that would be awesome. I'm thinking some routine that exports the file to a temporary directory and QLs it there. quicklook_containers.fp7.zip Link to comment Share on other sites More sharing options...
mweiss Posted March 25, 2009 Author Share Posted March 25, 2009 And yet another follow-up to my own post... The sample I uploaded has a small error of terminology: a field (and label) that refers to the POSIX path of the file is not, in fact, a POSIX path at all. You can trace my steps here: originally I planned to have the database calculate the POSIX path and then pass that through to the Applescript; then I changed my mind and decided to have the Applescript calculate the POSIX path. But I forgot to change my field name and label. So, it's sloppy and not very cosmetically nice. But it does work! Link to comment Share on other sites More sharing options...
Speekless Posted April 27, 2009 Share Posted April 27, 2009 Wow, this is actually very cool! I can't believe nobody replied to your post... thanks! Link to comment Share on other sites More sharing options...
mweiss Posted April 30, 2009 Author Share Posted April 30, 2009 I thought it was cool, too, and was similarly surprised that nobody ever seemed to notice my post. Thanks for confirming that I do, in fact, exist. Link to comment Share on other sites More sharing options...
P.G. Posted January 30, 2010 Share Posted January 30, 2010 This is really awesome! Well done! Very surprised about the lack of replies too, but thanks for sharing! Link to comment Share on other sites More sharing options...
ernst Posted June 20, 2010 Share Posted June 20, 2010 Very cool indeed! Link to comment Share on other sites More sharing options...
rivet Posted April 13, 2012 Share Posted April 13, 2012 Can anyone fix this example? Link to comment Share on other sites More sharing options...
rivet Posted April 13, 2012 Share Posted April 13, 2012 Solved it: setVariable: $file; table::container setVariable: $path; Get ( TemporaryPath )&$file setVariable: $script; Let ( thepath = Middle ( $path ; Position ( $path ; "/" ; 1 ; 2 )+1 ; Length ( $path) ) ; "set p to POSIX path of " & Quote(thepath) & "¶ do shell script \"qlmanage -p \" & quoted form of p") ExportFieldContents [table:container; $path] PerformAppleScript [$script] FMP-OSX-Quicklook-Container_fmp12.zip Link to comment Share on other sites More sharing options...
Newbies Aristide Posted August 23, 2012 Newbies Share Posted August 23, 2012 Thank you very much for this great work ! Do you know if it is possible to make it work with containers with external storage ? Link to comment Share on other sites More sharing options...
Newbies hsu912174 Posted April 30, 2013 Newbies Share Posted April 30, 2013 Great work on the solution. It worked on my database magically. However, I am wondering how I should adapt that to a container with multiple repetitions? So far I have tried to define another variable $rep using get(ActiveRepetitionNumber) and inserted it into every occurrence where repetitions are involved. It, however, keeps giving me this message: “” could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk. Would anyone shed some light on this? Thanks. Link to comment Share on other sites More sharing options...
Newbies pacificgregg Posted July 16, 2013 Newbies Share Posted July 16, 2013 Fantastic script!! I've never googled the solution to a problem, found the answer so simply and clear and implemented in 15 minutes! Initially I got the “” could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk. error but once I stripped off the document path info and just put the filename directly in the temporary path it works a treat! Thanks so much! Link to comment Share on other sites More sharing options...
Newbies joshhawk Posted November 4, 2013 Newbies Share Posted November 4, 2013 Great script! I've been using this for our solution, but seems not working correctly on 10.9 Mavericks... It shows the path of the file instead of the contents now. Any ideas? Thank you! Link to comment Share on other sites More sharing options...
Newbies joshhawk Posted November 4, 2013 Newbies Share Posted November 4, 2013 I think I found the solution... wasn't the applescript on OS X 10.9, but actually the script to define "thepath"... setVariable: $file; table::container setVariable: $path; Get ( TemporaryPath )&$file setVariable: $script; Let ( thepath = Middle ( $path ; Position ( $path ; "/" ; 1 ; 2 )+1 ; Length ( $path) ) ; "set p to POSIX path of " & Quote(thepath) & "¶ do shell script "qlmanage -p " & quoted form of p") ExportFieldContents [table:container; $path] PerformAppleScript [$script] I just took out the +1 from "Let ( thepath = Middle ( $path ; Position ( $path ; "/" ; 1 ; 2 )+1 ; Length ( $path) ) ;" and seems to preview the file correctly instead of returning the path text... Link to comment Share on other sites More sharing options...
Newbies AshInDenver Posted November 19, 2013 Newbies Share Posted November 19, 2013 Thanks joshhawk! That fixed it for me! Also, thanks to mwiess and your post from four years ago. This quick look script has been invaluable for our solution. Link to comment Share on other sites More sharing options...
Newbies Prometheus Kevin Trotsky Posted October 19, 2014 Newbies Share Posted October 19, 2014 This is an amazing trick. I upgraded to Yosemite and it broke. Any suggestions on what to fix... Also, is there a way to trigger same effect in Windows? Link to comment Share on other sites More sharing options...
Newbies AshInDenver Posted March 16, 2015 Newbies Share Posted March 16, 2015 I too can't get this to work in Yosemite. Does anyone have any insights? joshhawk?? Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3300 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now