Opening a curl downloaded file in Applescript?
Hi, kind of new to Applescript and hoping someone could help me. I am using a script to download an image file with curl to my Desktop (with the file named after the title of my active Google Chrome tab). This works fine and as expected.
The problem is the line afterwards where I want to open that file in another application. It's not working and I'm not sure why. I assume it's probably trying to open the URL path instead of the local file? I am trying to save the results of this (DownloadedImage.jpg) as a variable but not sure if I'm doing it right. This is the portion of the script:
set downloadedFile to (do shell script "curl -o " & quoted form of (savePath & tabTitle & ".jpg" as text) & space & quoted form of theURL)
tell application "Preview" to open "" & downloadedFile & ""
Any assistance would be much appreciated.
iMac, OS X El Capitan (10.11.4), 2012 iMac, 32GB RAM