Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Double quotes in applescript - do shell script

Featured Replies

I am sorry if this has been posted already. But the search system would not let me use those words.

I am trying to enclose double quotes in a "send apple script", script.

Here is my script.

"¶tell application "& """ & "Finder" & """ & "¶set myTest to do shell script "& """ &"md5 -q "& """ & "/Volumes/Extended/tmp/" & Duplicates::Filename & """ &"¶end tell ¶tell application "& """ &"FileMaker Pro Advanced"& """ &"¶set cell "& """ &"Duplicates::MD5"& """ &" of current record to myTest¶end tell"

"Duplicates::Filename" contains single quotes within the field, so I am unsure how to get that across to the terminal app.

Quoting problems are exactly why I don't suggest ever using that approach.

Use a script to move the data to global fields and then use Perform applescript command instead, something like this.

The purpose of using global fields is that you can use a table reference, you do not need to refer to a layout or current record.

Also, the "herestring" operator "<<<" means you don't have to actually write out the data to a file on disk.

set cellname1 to "zASData"

set cellname2 to "zASResult"

set tableName1 to "Gtest"

get data cell cellname1 of table tableName1

set mydata to result

set cmd to "md5 -q <<< " & quoted form of myData

do shell script cmd

copy result to cell cellname2 of table tableName1

  • Author

Thanks very much, I would not have looked at it like that!

  • Author

BruceR,

Okay, I had a chance to implement the new applescript, but I noticed a problem... The here-string is generating the md5 for the actual text within myData, but myData refers to a file location and name that needs to be evaluated by md5.

for example myData = /Volumes/Extended/tmp/_Alice's Restaurant Original Version.mp3 I want to evaluate that file not the text.

Could you please help?

Thanks again.

  • Author

I figured it out. I have never used the here-string before and looked it up. I just removed it from the calculation and that solved the problem. Thanks again!!!

Thomas

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.