dergachev / copy-public-url

A Folder Action Script that copies to clipboard the public URL of any newly created file inside of a public folder in Dropbox or Google Drive
26 stars 3 forks source link

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

Open paulirish opened 11 years ago

paulirish commented 11 years ago

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?

dergachev commented 11 years ago

@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 git@github.com: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 commented 11 years ago

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

https://gist.github.com/4658306

paulirish commented 11 years ago

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?

shedali commented 11 years ago

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

if you don't have growl installed

dergachev commented 11 years ago

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.

ghost commented 8 years ago

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