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.

Removing quotes from exported .csv

Featured Replies

So I have a working native applescript already:

 

set stringToFind to """

set stringToReplace to ""

set theFile to choose file

set theContent to read theFile as «class utf8»

set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, stringToFind}

set ti to every text item of theContent

set AppleScript's text item delimiters to stringToReplace

set newContent to ti as string

set AppleScript's text item delimiters to oldTID

try

set fd to open for access theFile with write permission

set eof of fd to 0

write newContent to fd as «class utf8»

close access fd

on error

close access theFile

end try

 

I want to eliminate the "choose file" step at the beginning since the file location is in a filemaker variable already, but if I change to it being a calculated script (only major changes in the first three lines):

 

"set stringToFind to """¶
set stringToReplace to ""¶
set theFile to " & Quote($filePath) & "¶
set theContent to read theFile as «class utf8»¶
set {oldTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, stringToFind}¶
set ti to every text item of theContent¶
set AppleScript's text item delimiters to stringToReplace¶
set newContent to ti as string¶
set AppleScript's text item delimiters to oldTID¶
try¶
    set fd to open for access theFile with write permission¶
    set eof of fd to 0¶
    write newContent to fd as «class utf8»¶
    close access fd¶
on error¶
    close access theFile¶
end try"
 
I get the error: "Expected end of line, etc. but found identifier."
  • Author

I figured it out. I don't have "tell" blocks. The native script worked because without a tell block it assumes to mean you are telling the Finder, but for calculated applescripts it assumes you are telling Filemaker. Changing to :

 

tell application "Finder"
    --my code
end tell

 

fixed it

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.