Jump to content

a weird quirk using the AppleScript step


kgasman

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

Recommended Posts

I use AppleScript step to do many file manipulations using AppleScript. I usually pass the results of the AppleScript to Filemaker by setting a text Field from within the AppleScript step. This has worked fine until I tried to create the following AppleScript. The Goal of the AppleScript was to find out if the Dropbox folder existed and if it existed see if the folder "Client Audio files" existed. If Client Audio files didn't exist then create it. Finally pass the location of the DropBox folder back to Filemaker.

I used the following Applescript:

--Does Dropbox exist

 

set {theDropboxFolder} to Does_Dropbox_Folder_Exist()

 

--send results to Filemaker Pro

 

setFilemakerpro(theDropboxFolder)

 

 

on Does_Dropbox_Folder_Exist()

set theDropboxFolder to (path to home folder as text) & "Dropbox:"

 

if exists (theDropboxFolder) then

set theDropboxFolder to theDropboxFolder & "AllynDocuments:"

set ClientAudioFiles to theDropboxFolder & "Client Audio files:"

Make_Sure_There_is_Client_Audio_Folder(ClientAudioFiles)

else

set theDropboxFolder to "No Dropbox Folder"

end if

return {theDropboxFolder}

end Does_Dropbox_Folder_Exist

 

on Make_Sure_There_is_Client_Audio_Folder(ClientAudioFiles)

tell application "Finder"

if not (exists folder ClientAudioFiles) then

make folder at myFolder with properties {name:"Client Audio files"}

display dialog "A folder for your Clients to download sound files was created in the dropbox folder. This folder named Client Audio files will contain a sound files you create."

end if

end tell

end Make_Sure_There_is_Client_Audio_Folder

 

 

 

on setFilemakerpro(theDropboxFolder)

--tell Filemaker the DropBox location

 

tell application "FileMaker Pro"

tell table "Preferences"

tell record 1

set cell "DropboxFolder" to theDropboxFolder

end tell

end tell

 

end tell

end setFilemakerpro

When I run this script the set cell "DropboxFolder" to theDropboxFolder fails with Parameter is not an object specifier, then gives Error -1727. 

Weirdly I can run this script in the Script Editor and it works fine

 

any thoughts

Kevin

 

Link to comment
Share on other sites

This topic is 820 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.