Jump to content
Server Maintenance This Week. ×

Shell Script With Apple Script - Syntax


This topic is 4887 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Does anyone see where the syntax in this calculated Apple Script is off? It returns two errors:

1. "Expected """" but found unknown token

2. Unknown Error -2741

Here's what the code looks like:

List (

"set fileExists to false";

"try";

"do shell script \"-e '" & $path & "'\"";

"set fileExists to true";

"end try";

"tell me to set cell \"result\" of layout \"Developer_Settings\" to fileExists"

)

What I'm trying to accomplish is simply check if a file exists in a certain location.

The $path consists of: Get (FileMakerPath) & "\Extensions\Troi_File.fmplugin

Link to comment
Share on other sites

Don't you love it when you can post your own replies...? ;-)

I hope this will be helpful to someone. Here's the updated code:

List (

"set fileExists to false";

"try";

"do shell script \"test -e '" & $path & "'\"";

"set fileExists to true";

"end try";

"tell me to set cell \"_yourfieldname\" of layout \"_yourlayoutname\" to fileExists"

)

The variable $path needs to start with "Volumes" for AppleScript to understand. If you're looking to verify a plug-in in the non-shared Extensions folder of your FileMaker installation, this should work:

"Volumes" & Get (FileMakerPath) & "Extensions/_yourpluginname"

Link to comment
Share on other sites

This topic is 4887 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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