Two (possible) Bugs in the AppleScript implementation


#1

Two things that should work but don´t work as expected (version 7.0.14b5 (834)):

First: The ebay shipping service has the property “shipping destinations” to set the shipping destinations of a shipping service. But trying to set that gives an error. setting the fee works as expected:

  tell application "GarageSale"
    repeat with theListing in (get selected ebay listings)
        set theOption to (the shipping option of theListing)
	    tell theOption
                    add shipping service service name "DHL Paket International" with international
                    repeat with theService in the second ebay shipping service
                         set fee amount of theService to 32.0
                         set shipping destinations of theService to "Spanien"
                    end repeat
                end tell
        end repeat
   end tell

This creates an international shippings service with a fee of 32 Euro, but gives me an error for the line " set shipping destinations of theService to “Spanien”:

„GarageSale“ hat einen Fehler erhalten: 
„shipping destinations of item 1 of ebay shipping service 2 of ebay shipping option id 
"7B501260-B44F-49DB-841E-90E6638EEAFF" of ebay listing id 
"F0A24385-E5F8-40C0-9D27-54E56110A89F"“ kann nicht als „"Spanien"“ gesetzt werden.

Setting the shipping destination of the shipping options (which are then valid for ALL shipping services) works, (but is not what I need) using "set shipping destinations to “Spanien”. Other values like “use additional fee”, “additional fee amount” and others work.

16

Second: Setting the secondary store category id does not work through AppleScript. The primary store category id works as expected. Trying to set both values with different IDs only sets the primary one, exchanging them sets the primary to the new value, but the secondary is still unchanged, even when using the ID that worked well on the primary before.

Initial setting:
53

Script:

tell application "GarageSale"
  set theListing to the first item of (get selected ebay listings)
  set primary store category id of theListing to "5613762011"
  set secondary store category id of theListing to "5613761011"
end tell

Result:
04

Now I exchange the values within the script:

tell application "GarageSale"
  set theListing to the first item of (get selected ebay listings)
  set primary store category id of theListing to "5613761011"
  set secondary store category id of theListing to "5613762011"
end tell

Result:
19

Thats the proof that both values are valid, but the second can´t be set.

BTW: I don´t need all possible parameters that are to be set by Apple Script - but should I check them all for buggy ones to help you testing?


#2

Concerning the “shipping destination” issue, that was indeed broken and should be fixed in this build:

http://downloads.iwascoding.com/downloads/GarageSale_7_2018-04-13.dmg

Also, I’m not sure about the repeat … in the second eBay service line. Maybe this works better:

tell application "GarageSale"
repeat with theListing in (get selected ebay listings)
	set theOption to (the shipping option of theListing)
	tell theOption
		add shipping service service name "DHL Paket International" with international
		repeat with theService in every ebay shipping service
			if is international of theService is true then
				set shipping destinations of theService to "Spanien"
			end if
		end repeat
	end tell
end repeat

end tell

Unfortunately I couldn’t reproduce the issue with the secondary store category. Does it work if you choose another store category, or if you briefly select another listing after running the script?


#3

Thanks for the fix.
Setting the destination of the shipping service works now.
The line “… in the second eBay service” was just a quick and dirty fix for the fact that I haven´t found out the correct syntax for directly adressing a shipping service by its name. if I use

    repeat with theService in every ebay shipping service
	     if is international of theService is true then
		   set shipping destinations of theService to "Spanien"
         end if
	end repeat

I change EVERY international shipping service within the listing (and I have two or three in each listing). But the fix itself helps much, thanks.

I am testing the shop category thing again now…

Same as before.
Heres the script:

tell application "GarageSale"
	set theListing to the first item of (get selected ebay listings)
	set primary store category id of theListing to "5613767011"
	set secondary store category id of theListing to "5613760011"
end tell

Both values (they are different) are valid, but they only change the primary value. The second is left untouched, even if I go to another listíng and then back.
Be aware that I mean the STORE categories of my own ebay store, not the EBAY categories.

Is it normal that the two ids accept different kinds of values? the primary accepts "integer, number, or text, the secondary “integer” only?

From the dictionary:

primary store category id (integer, number, or text) : Its primary store category id.
secondary store category id (integer) : Its secondary store category id.

The shop category thing would be a bit critical for me, I will start about 1.100 new listings these days, and as long as setting the secondary store category id does not work through applescript, I would need to do that by hand… 1.100 times…

And did you have time to have a look into my other request (AppleScript questions & requests GS7 / shipping)
for adding two apple script commands to the odrders suite, so I can get the shipping service that the buyer had chosen and that I can set the shipping service name I used? Would be very nice :slight_smile: No super-hurry, but a very nice thing to have…

**_[quote=“ilja, post:2, topic:4214, full:true”]
Concerning the “shipping destination” issue, that was indeed broken and should be fixed in this build:

http://downloads.iwascoding.com/downloads/GarageSale_7_2018-04-13.dmg

Also, I’m not sure about the repeat … in the second eBay service line. Maybe this works better:

tell application "GarageSale"
repeat with theListing in (get selected ebay listings)
	set theOption to (the shipping option of theListing)
	tell theOption
		add shipping service service name "DHL Paket International" with international
		repeat with theService in every ebay shipping service
			if is international of theService is true then
				set shipping destinations of theService to "Spanien"
			end if
		end repeat
	end tell
end repeat

end tell

Unfortunately I couldn’t reproduce the issue with the secondary store category. Does it work if you choose another store category, or if you briefly select another listing after running the script?
[/quote]

And one last thing: As you started with GarageSale 7 some time ago I thought “Urg… I don´t like that new design and how it works…”.
But now that I am using it: IT IS VERY WELL DONE! Much better than before! I like it and it makes my life MUCH easier (my worklife…) Thanks for that! Great work!:+1:


#4

Maybe something like this works better:

tell application "GarageSale"
repeat with theListing in (get selected ebay listings)
	set theOption to (the shipping option of theListing)
	tell theOption
		set theService to add shipping service service name "DHL Paket International" with international
		repeat with theService in (every ebay shipping service whose service name is "DHL Paket International")
			set shipping destinations of theService to "Spanien"
		end repeat
	end tell
end repeat

end tell

I changed the AppleScript definition for the secondary store category attribute. Maybe this resolves the problem at your place:

http://downloads.iwascoding.com/downloads/GarageSale_7_2018-04-13_1.dmg


#5

Thanks for the Apple Syntax Hint, very helpful - as I still learn everyday, this is very helpful :slight_smile:

I changed the AppleScript definition for the secondary store category attribute. Maybe this resolves the problem at your place.

Yes! Thanks very much for that, now it works as expected!
Now I can start working :smile:


#6

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.