Been having trouble trying to debug my script.
Im trying to convert .webp files to png so I could actually see them in DT.
So far I’ve created a bash script that converts webp to png using dwebp. Works. Only issue is trying to debug what went wrong in the applescript process.
This is what I have so far
There is probably an easier way to do this or Im going about this wrong.
End goal is being able to view images through DTs webkit browser; safari. This was the easiest way of doing this without saving as HTML, as I hate saving as HTML because it’s not portable later.
Many of my files are memes and other images that are saved in image format that I bookmark and organize with DT. I use chrome so all my files are being saved as .webp but DTs internal browser safari cannot view them.
So far saving to a folder then converting using hazel then running the bash script to convert webp to png then dragging the PNG into DT, but thats such a hassle as hazel is such a process hog sometimes and I only have it running for this one process which Id rather just get rid of hazel all together.
So far I’ve created the bash file and sort of put together this applescript… Im not familiar at all with AS. shell script is +x as well.
– WEBP TO PNG
tell application id “DNtp”
try
set this_selection to the selection
if this_selection is {} then error “Please select some images.”
repeat with this_item in this_selection
try
do shell script "/Users/ron/Library/Application Scripts/com.devon-technologies.think3/Menu/Images/webp2png.sh " & this_selection
end try
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert “DEVONthink” message error_message as warning
end try
end tell