I have the following problem and I’m unable to come up with a reason why my AppleScript droplet crashes.
The script is attached below. Whenever I run it, I get a SIGBUS error and I get the dialog saying the application has unexpectedly quit. I’ve even tried creating a new project and having a statement like “tell application “Finder” / display dialog “Hello” / end tell” And it still gives me the same thing. I’ve tried this on 2 different computers. If anyone has some insight into what the problem would be, I would appreciate it.
on open fp7files
tell application "FileMaker Developer"
activate
open item 1 of fp7files
set f to item 1 of fp7files
set numrec to count record of window 1
set recPoint to 1
repeat while recPoint ? numrec
go to record recPoint
copy cell 1 of record recPoint to artifactName
do script "Export Field Contents"
tell application "Finder"
set myPath to container of f as text
set imgPath to myPath & "tmp.jpg"
try
set name of file imgPath to artifactName & ".jpg"
on error
try
delete imgPath
end try
end try
end tell
set recPoint to recPoint + 1
end repeat
quit
end tell
quit
I’ll give that a try. But the problem isn’t so much with the script it seems but rather AppleScript droplets. I meant to say in my last post is that I’ve tried to create a new project with empty bodies and just had that single tell application “Finder” statement and it would still crash. I’m not sure if it’s some setting in Xcode or what. It is quite frustrating.
Ah, you didn’t mention this was an Xcode project before (and it wasn’t in the AppleScript Studio forum). Is there something else that you’ve not posted that requires an AppleScript Studio interface? If not, this is a pretty basic droplet and you could just use the Script Editor to create the application with much less overhead.
Yeah, there’s no application interface for it. Just that script… I chose the droplet so that I could just drop arbitrary filemaker files on it to export (the script is essentially to facillitate conversion from filemaker format to PostGreSQL). This is actually my first attempt at AppleScript so I’m not sure if I’m calling something (or not ending something properly) that would cause a SIGBUS error to occur. If there would be an easier way to do it outside of Xcode, that would be great