copy-public-url icon indicating copy to clipboard operation
copy-public-url copied to clipboard

error: Expected end of line, etc. but found “"”. (-2741)

Open paulirish opened this issue 12 years ago • 6 comments

compiling manually on os x 10.8.2 I've set my default ID in the config sh.

$ bash INSTALL.sh 
Ensuring '/Users/paulirish/Library/Scripts/Folder Action Scripts/' exists
Performing find-and-replace; setting property YOUR_DROPBOX_ID to '39519'
compiling copy-public-url.scpt
/Users/paulirish/code/copy-public-url/copy-public-url.applescript.modified:158: error: Expected end of line, etc. but found “"”. (-2741)
Creating symlink to dropbox-copy-public-url.scpt inside '/Users/paulirish/Library/Scripts/Folder Action Scripts/'
cleaning up: removing temporary files
Don't forget to associate copy-public-url.scpt as Folder Action for the desired folder.

Not really sure what's going on here as I'm unfamiliar with applescript syntax.. Any ideas why it's barfing on compile?

paulirish avatar Jan 28 '13 02:01 paulirish

@paulirish - thanks for giving this a try!

I wasn't able to reproduce your error (also on 10.8.2); the following worked

I cloned this repo to a new folder, and the following worked:

$ git clone [email protected]:dergachev/copy-public-url.git
$ cd copy-public-url
$ bash INSTALL.sh 123456
Ensuring '/Users/dergachev/Library/Scripts/Folder Action Scripts/' exists
Performing find-and-replace; setting property YOUR_DROPBOX_ID to '123456'
compiling copy-public-url.scpt
Creating symlink to dropbox-copy-public-url.scpt inside '/Users/dergachev/Library/Scripts/Folder Action Scripts/'
cleaning up: removing temporary files
Don't forget to associate copy-public-url.scpt as Folder Action for the desired folder.

To debug, comment out the last line INSTALL.sh which reads as following:

rm "$SOURCE_SCRIPT.modified"

Then re-run INSTALL.sh and you'll have copy-public-url.applescript.modifier in the folder. Rename it as copy-public-url.applescript.modifier.applescript (or something) and try opening it up in Applescript Editor. If that fails, post it here and I'll take a look.

The line 158 was in the Growl section, so perhaps you don't have Growl installed? That would be a known issue: #7. However I'm pretty sure Dropbox bundles it in: https://www.dropbox.com/help/48/en

dergachev avatar Jan 28 '13 14:01 dergachev

To test if growl is present, you can try opening and running this debug applescript:

https://gist.github.com/4658306

dergachev avatar Jan 28 '13 19:01 dergachev

The quote mark the error is about is the very first quote in this line:

"CopyDropboxURL" all notifications allNotificationsList

I don't have growl installed and likely won't install it, as they now have shifted to an App Store paid policy. Can the copy-public-url continue regardless of if growl is installed?

paulirish avatar Feb 03 '13 21:02 paulirish

you can replace the surrounding if-else block with something like: display dialog "copied"

if you don't have growl installed

shedali avatar May 05 '13 03:05 shedali

At some point I'll need to get around to rewriting this to use 10.8 notification center.

@shedali - Unfortunately Applescript is sort-of statically compiled, which means if my code references Growl, it must be installed.

dergachev avatar May 08 '13 18:05 dergachev

To find if an application is installed without having to run the application, use:

try
    tell application "Finder" to get application file id "bundle.id.here"
    set appExists to true
on error
    set appExists to false
end try

Source: http://stackoverflow.com/questions/14297644/check-if-an-application-exists-using-applescript

ghost avatar Sep 12 '16 06:09 ghost