0
votes

I am a complete applescript virgin and I have 2 versions of the same application that use different frameworks that have the same name.

I'm looking to create 2 scripts that move the correct version of the framework into the frameworks folder so I can swap them out quickly from the desktop.

This is what I have so far but it is throwing up an AppleEvent Handler failed -10000 error.

tell application "Finder"
    duplicate POSIX file "Machintosh HD/Framework Store/Test.framework" to POSIX file "Machintosh HD/Library/Frameworks/Test.framework" with replacing
end tell

Can someone point out where I am going wrong?

Any help is greatly appreciated.

2

2 Answers

0
votes

Just noticed you also had the Had disk name. The first forward slash "/" is all you need to refer to that.

 tell application "Finder"
    set rootFolder to POSIX file "/Framework Store/Test.framework"
    set targetFolder to POSIX file "/Library/Frameworks/"
        duplicate rootFolder to targetFolder with replacing
  end tell
0
votes

Try:

tell application "Finder"
    duplicate POSIX file "Machintosh HD/Framework Store/Test.framework" to POSIX file "Machintosh HD/Library/Frameworks" with replacing
end tell