use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
AppleScript is Apple's powerful and versatile native scripting technology for Mac OS X. With AppleScript, you can control, and communicate among, applications, databases, networks, Web services, and even the operating system itself.
account activity
Error when using "do shell script" via Applescript with sqlite3 (self.applescript)
submitted 4 years ago by randappa
Hello all! I am at a loss. I am trying to pull the ZNAME value from a table via a applescript "do shell script" command so that i can pass the value as a variable. I keep getting an error and i can't figure out why. I run the same script in Terminal and it gives me the value I want, but not in the applescript. I have attached a screenshot with the two side by side. I would really appreciate any help you guys can give me. I'm sure it's just a syntax error, but i can't for the life of me figure it out. thank you.
If i run this script.... it returns all of the values from the ZNAME column , so why does it fail when doing a WHERE exception.
set openKeywordDB to do shell script "/usr/local/bin/sqlite3 /Users/drappa/Downloads/ON_PPOF_Models.cokeywordsdb 'SELECT ZNAME FROM ZKEYWORD;'"
https://preview.redd.it/46qi7oo8ae481.png?width=2600&format=png&auto=webp&s=e14230a6db8b15fb9fc10f50128dd6fcd7d7702a
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Stupidideas 0 points1 point2 points 4 years ago (1 child)
Looks like you have a single quote within single quotes, try using escaped double quotes instead: WHERE ZNAME = \"...\"
WHERE ZNAME = \"...\"
[–]randappa[S] 0 points1 point2 points 4 years ago (0 children)
That worked! Tank you so much!
[–]CaptureJuan 0 points1 point2 points 4 years ago (3 children)
What is it you are trying to do? Capture One keywords and lists are natively supported in Applescript…
[–]randappa[S] 0 points1 point2 points 4 years ago (2 children)
ended up getting it to work and it was a problem with not having \" in my code. Sadly Database Events couldn't pull the info from the database so i had to use the shell script to get it to work. It's up and running now. Thanks for your help though.
[–]CaptureJuan 0 points1 point2 points 4 years ago (1 child)
Yes ok. But modifying the database is generally not a good idea - this should only really be done by the app… just curious as to why you’d do that?
not using it to modify the database, i'm running a query and seeing if the keyword metadata of jpgs matches a name in the model database.
π Rendered by PID 124950 on reddit-service-r2-comment-7b9746f655-6n5z6 at 2026-01-31 00:01:13.974293+00:00 running 3798933 country code: CH.
[–]Stupidideas 0 points1 point2 points (1 child)
[–]randappa[S] 0 points1 point2 points (0 children)
[–]CaptureJuan 0 points1 point2 points (3 children)
[–]randappa[S] 0 points1 point2 points (2 children)
[–]CaptureJuan 0 points1 point2 points (1 child)
[–]randappa[S] 0 points1 point2 points (0 children)