News:IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).

I'm using runCommand and curl to submit posts to Tumblr. It works like a champ except line breaks are showing up in Tumblr as

Code:

% d% d

Since this is being done through a GET, I have to use urlEncode() and I'm wondering if that isn't where the problem is occurring.

I am editing text in Byline and then pasting it into the note but I don't see why that should have any effect. If I paste from Byline into other text editors, nothing suspicious shows up. If I paste into other text editors from Tinderbox the text originally pasted from Byline, also nothing suspicious shows up.

What command line are you trying to run & how are you constructing it in TB? It would be easier to help if we can see the code you are using. Things like passwords can be obfuscated, it's seeing what's getting encoded where that will help.

I'd take the just runComand part of your code, i.e. $Result = runCommand(...);, and remove the 'runCommand part and see what $Result holds. You could also pass the output to a file via the shell and see what turns up. I should note I'm not a command line expert but there are a few forum members with CL smarts who may have a better idea.

If the demo you worked from was my old Twitter demo, it has roots going back pre-TB v5 when output changed from ASCII to UTF-8, so that might be a factor. Still as you're effectively passing a URL, urlEncode() still seems a logical choice. I've not used the Twitter demo in a long time as since changes to the API enhancing security, I'm not sure the posting part works. However, it should still be possible to read data out from Twitter.

I think the last single quote here is superfluous (and likely ignored). The previous single quote is within a string literal and in the output it closes a single-quote-delited string started in another literal, just after '-d'.

The issue of the double execution remains, however. I was thinking, is it possible that it's executing twice because the OnAdd code refers to $Result? In the code, it executes the runCommand() and then uses the $Result to populate $Url so that the published note refers to where it exists on the Tumblr.

It's the only thing I can think of that could be causing the double execution. There only agents I have just change a note's color based on the tag the note is given.

I'm trying now to think if the double posting started with the urlEncode() fix... If it helps, I notice that the post number returned by Tumblr is always the second post's number which leads me to believe that it's definitely something with Tinderbox. It's sending the post twice and keeping the second number.

[Edited to add]: The double posting issue was discussed in e-mail. To sum up, when I drag a note onto the adornment with the runCommand() OnAdd code, it's getting published to Tumblr twice.

If runCommand() produces an end in it's own right, there's no real need to use the 'Result = ' bit. I'm not privy to the email conversation so can only go in info here, but what is the exact result of you curl command line. Does it do something via the CL and/or just return a string?

So you call the runCommand in an adornment's OnAdd. It should thus fire once, when a note is added. Of course if a note is re-added or the 'note' added is an alias or it's a smart adornment a note might get added/removed/re-added. But there's insufficient info at present to diagnose further.

First, you're right about the $Result bit. To test my theory that maybe the second reference to $Result was causing the runCommand() to refire, I simply attached the runCommand() to the bit which creates the $URL. (The value returned from runCommand() is the post number which, when suffixed to the domain name, produces the permalink.) It works great without needing the $Result attribute but it still executes twice.

To post a note, I drop it on the smart adornment the OnAdd command of which executes the runCommand() code and then moves the note into a Published container.

What I'm almost now quite sure of is that it didn't initially double-post so I'm wondering if the fix that Mark B. provided might have introduced the double-post bug.

I'd remove all the variables - i.e. make a string literal of the curl CL. I'd run it from the Terminal CL and confirm you get only one post. Now I'd make the $OnAdd just run runCommand() using the string literal. Check for double execution.

Testing with v5.9.3, I can't get other action code in an adornment $OnAdd to execute twice - IOW I don't think there's a generic double-tap going on with $OnAdd**. I doubt the fix for urlEncode would cause runCommand to run twice. If it does narrow down to runCommand in OnAdd use, I'd say it points to some edge case with the specific use of runCommand. For that level of testing, I think support might want to see your file. Anyway, i'd follow up that route - I don't think it's anything obvious that fellow users can fix.

** I have a very dim remembrance that $OnAdd has - over the years occasionally had issue, but as I say this is best followed up directly with support.