NNWInstaPost Follow Up
January 4th, 2009
Hmmmm couple of people have reported a strange path issue with NNWInstaPost. So here is version 1.01 that seems to be helping that odd issue. Do let me know if that’s still not working
Update:
So that seems to have fixed things for people with the issue. It appeared to be some odd caching issue that I can’t consistently repeat – you know, the kind of bug that is very irritating
Thanks to: Michael L, Arthur M, Woody G, Andrew J, Matthew D, Joshua B, Rich M and others for their help tracking this one down.
Comments
[...] make sure you get the latest version for the script to [...]
I think the underlying problem was a scoping issue. I’m not an AppleScript expert, but it seems like the values set to properties are fixed when the script is compiled. Since prefs_path needs to change based on the user running the script, it doesn’t work as a property.
Since prefs_path is only used in credentials(), I fixed my copy by changing it to be a local variable inside that function. Specifically, I inserted
set prefs_path to (path to preferences as text)
as the first line after “on credentials()” and removed the property declaration for prefs_path. This fixed the problem for me.
BTW, thanks for this script. I was previously using one which scripted Safari to invoke the “read later” bookmarklet, but NNWInstaPost’s direct approach is much cleaner and works better when Safari isn’t already running.
interesting isn’t it? seems odd that a compiled script would cache variables but it does look like that’s what is happening. but in v1.01 of the script i set the path on demand so that shouldn’t happen. glad you like the approach – i just wanted a quick background method of posting to InstaPaper – i hate having my context broken. enjoy
This script is exactly what i’ve been looking for (at least until Instapaper support is baked into NNW).
I’ve even tried to make an automator action to do this, but ended up nearly having an aneurism out of frustration.
The only thing that bothers me is when I call the script, NNW hangs until it’s finished. The hang time depends on how big the page is that i’m adding to Instapaper.
well automator is fun for some things but not so great for others
hmm interesting about the hang time. it shouldn’t be dependant on how big the page is because all NNWInstaPost sends is the title and the url, not any page data. so the hang time is more likely to be dependant on the response time from InstaPaper. AppleScript tends to block quite a bit – i guess i could always look at creating a thread within bash to return to NetNewsWire quicker… but i’m not seeing much delay here, maybe 1/2 a second before the return
I know that beggars can’t be choosers, but is there a version of this that doesn’t rely on Growl? I looked at the code and it seemed that taking out Growl would be trivial, although my attempts to do so failed miserably.
sure – but you won’t get any indication that it’s finished. all you need to do is change line:
triggerGrowl(talkToNNW())
to
talkToNNW()
and save it and you should be all set. hope that works for you
After going into the script itself to change my instapaper password, it no longer runs correctly. I tried installing the script from scratch, but it does not run as if it’s the first time, and therefore does not ask for my username or password. It still delivers a growl notification that the article has been posted, but no such posting actually occurs. Any help would be appreciated.
so what you need to delete is the file where the password is stored:
/users/your_user_ name_/preferences/protagonist.post.txt
and you could also delete the cookie:
/tmp/instacookie.txt
then rerun the script and NNWInstaPost will go through the initial prompting and all should be well.
Hmmm. Haven’t been able to get this to work. I was able to use it to post one item to InstaPaper but I now receive the error:
protagonist.post.txt wasn’t open.
The file exists here: File Users:[my username]:Library:Preferences:protagonist.post.txt
Would love to get this up and running!
interesting error – so i would try deleting the protagonist.post.txt file and the the next time you add a post to instapaper, it should prompt you for username and password. step through that again and give it a go. the protagonist.post.txt file is where the username and password are stored.
hope that works out for you