Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   General (https://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Still getting the AppleScript syntax error, after resetting LaunchServices DB w/Onyx (https://www.shirt-pocket.com/forums/showthread.php?t=4052)

jjj 05-06-2008 01:44 AM

Still getting the AppleScript syntax error, after resetting LaunchServices DB w/Onyx
 
... and pulling these "do shell script" lines back out of "Copy Job.applescript" eliminates the syntax error dialog when I try to schedule the backup. So what am I doing wrong:

Code:

on beforeRunningCopy()
        -- Put your own code here that should execute just before running the copy.
        do shell script "diskutil mount /dev/disk1s3 /Volumes/Biggus\ Discus"
end beforeRunningCopy

on afterRunningCopy()
        -- Put your own code here that should execute just after running a successful copy.
        do shell script "diskutil unmount /Volumes/Biggus\ Discus"
end afterRunningCopy

I need to mount/unmount because this backup script is writing to a sparseimage on an external drive that should stay unmounted day-to-day. My other backup writes directly to a separate partition on this drive for a mirror backup, and I know SD handles the mounting/unmounting in that case automatically.

If I must, I suppose I can do it outside of SD. But it seems like the kind of thing I ought to be able to do here or somewhere inside the app. (Alas, trying to use the "Run shell script before copy starts" checkbox option doesn't mount the drive in time for SD to notice it I guess.)

dnanian 05-06-2008 07:59 AM

You get an error when compiling the script?

jjj 05-06-2008 08:06 AM

1 Attachment(s)
Yes:

"Failed to schedule automatic copy. An error occurred while trying to schedule the copy for automatic execution. If you modified the AppleScript, please endure that the script syntax is correct and try again."

Image attached.

dnanian 05-06-2008 08:38 AM

Try compiling it again, and then send me a System Profiler report to the support email address.

jjj 05-06-2008 09:21 AM

Emailed. But I'm guessing this will be the part you're interested in:

Code:

console.log:

  Description:        User events log
  Size:        54.73 KB
  Last Modified:        5/6/08 8:09 AM
  Location:        /Library/Logs/Console/501/console.log
  Recent Contents:        ...
2008-05-06 07:01:47.159 SuperDuper![1966] .scriptSuite warning for type 'NSTextStorage' attribute 'title' of class 'NSWindow' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 07:01:47.159 SuperDuper![1966] .scriptSuite warning for attribute 'boundsAsQDRect' of class 'NSWindow' in suite 'NSCoreSuite': 'NSData<QDRect>' is not a valid type name.
2008-05-06 07:01:47.160 SuperDuper![1966] .scriptSuite warning for superclass of class 'NSAttachmentTextStorage' in suite 'NSTextSuite': 'NSString' is not a valid class name.
2008-05-06 07:03:14.779 SuperDuper![1975] .scriptSuite warning for attribute 'boundsAsQDRect' of class 'NSWindow' in suite 'NSCoreSuite': 'NSData<QDRect>' is not a valid type name.
2008-05-06 07:03:14.779 SuperDuper![1975] .scriptSuite warning for type 'NSTextStorage' attribute 'name' of class 'NSApplication' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 07:03:14.779 SuperDuper![1975] .scriptSuite warning for type 'NSTextStorage' attribute 'lastComponentOfFileName' of class 'NSDocument' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 07:03:14.779 SuperDuper![1975] .scriptSuite warning for type 'NSTextStorage' attribute 'title' of class 'NSWindow' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 07:03:14.779 SuperDuper![1975] .scriptSuite warning for attribute 'boundsAsQDRect' of class 'NSWindow' in suite 'NSCoreSuite': 'NSData<QDRect>' is not a valid type name.
2008-05-06 07:03:14.780 SuperDuper![1975] .scriptSuite warning for superclass of class 'NSAttachmentTextStorage' in suite 'NSTextSuite': 'NSString' is not a valid class name.
2008-05-06 07:03:48.262 SuperDuper![1975] LOGGED EXCEPTION: SDAppleScriptTemplateLoadError, reason: Unable to load AppleScript template: {
    NSAppleScriptErrorBriefMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = <33010000 01000000 >;
}, userInfo: (null)

2008-05-06 07:03:48.263 SuperDuper![1975] Exception raised while scheduling automatic copy: EXCEPTION: SDAppleScriptTemplateLoadError, reason: Unable to load AppleScript template: {
    NSAppleScriptErrorBriefMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = <33010000 01000000 >;
}
2008-05-06 08:06:30.443 SuperDuper![2033] .scriptSuite warning for attribute 'boundsAsQDRect' of class 'NSWindow' in suite 'NSCoreSuite': 'NSData<QDRect>' is not a valid type name.
2008-05-06 08:06:30.443 SuperDuper![2033] .scriptSuite warning for type 'NSTextStorage' attribute 'name' of class 'NSApplication' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 08:06:30.443 SuperDuper![2033] .scriptSuite warning for type 'NSTextStorage' attribute 'lastComponentOfFileName' of class 'NSDocument' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 08:06:30.444 SuperDuper![2033] .scriptSuite warning for type 'NSTextStorage' attribute 'title' of class 'NSWindow' in suite 'NSCoreSuite': AppleScript name references may not work for this property because its type is not NSString-derived.
2008-05-06 08:06:30.444 SuperDuper![2033] .scriptSuite warning for attribute 'boundsAsQDRect' of class 'NSWindow' in suite 'NSCoreSuite': 'NSData<QDRect>' is not a valid type name.
2008-05-06 08:06:30.444 SuperDuper![2033] .scriptSuite warning for superclass of class 'NSAttachmentTextStorage' in suite 'NSTextSuite': 'NSString' is not a valid class name.
2008-05-06 08:08:32.321 SuperDuper![2033] LOGGED EXCEPTION: SDAppleScriptTemplateLoadError, reason: Unable to load AppleScript template: {
    NSAppleScriptErrorBriefMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = <33010000 01000000 >;
}, userInfo: (null)

2008-05-06 08:08:32.321 SuperDuper![2033] Exception raised while scheduling automatic copy: EXCEPTION: SDAppleScriptTemplateLoadError, reason: Unable to load AppleScript template: {
    NSAppleScriptErrorBriefMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorMessage = "Expected \U201c\"\U201d but found unknown token.";
    NSAppleScriptErrorNumber = -2741;
    NSAppleScriptErrorRange = <33010000 01000000 >;
}


dnanian 05-06-2008 10:00 AM

Yep. And if you open Script Editor, and paste your script line in, you'll see it gives the same error. Try doubling the backslash.

sanketr 12-27-2009 11:34 AM

I think I am seeing similar issue with saving scheduled job - I had SD 2.5 installed before, with scheduled jobs. I then upgraded my iMac from Leopard to Snow Leopard 10.6.2, and then upgraded SD to latest version through update menu. After that, I deleted the older scheduled jobs through Scheduler menu of SD, and then tried to create a new scheduled job, when I got the error message as mentioned in this thread. I then used Onyx to rebuild LaunchServices, restarted the mac, and tried again to save scheduled job. Still the same issue. Will appreciate finding out what debugging steps are, to get to the bottom of this issue.

I found this in SD log:
| 12:36:59 PM | Info | EXCEPTION: SDAppleScriptTemplateLoadError, reason: Unable to load AppleScript template: <CFBasicHash 0x16a49bc0 [0xa0bdeee0]>{type = mutable dict, count = 4,
entries =>
2 : <CFString 0xa01087e8 [0xa0bdeee0]>{contents = "NSAppleScriptErrorRange"} = NSRange: {13486, 8}
4 : <CFString 0xa01087a8 [0xa0bdeee0]>{contents = "NSAppleScriptErrorNumber"} = <CFNumber 0x16a3cf70 [0xa0bdeee0]>{value = -2741, type = kCFNumberSInt16Type}
5 : <CFString 0xa01087b8 [0xa0bdeee0]>{contents = "NSAppleScriptErrorMessage"} = <CFString 0x16a76700 [0xa0bdeee0]>{contents = "Expected end of line but found identifier."}
6 : <CFString 0xa01087c8 [0xa0bdeee0]>{contents = "NSAppleScriptErrorBriefMessage"} = <CFString 0x18d0d4b0 [0xa0bdeee0]>{contents = "Expected end of line but found identifier."}
}

dnanian 12-27-2009 03:04 PM

Try deleting your existing copy of SD, emptying your trash, restarting your Mac and reinstalling.

sanketr 12-29-2009 11:13 AM

It worked after I followed above steps of deleting and reinstalling. Thanks!


All times are GMT -4. The time now is 04:04 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.