Applescript problems (Here: Shipping) when GS6 and GS7 are both installed (solved) - read last post


#1

Read third post about the problems when you have GarageSale 6 and 7 installed and try to use AppleScript! This is not a GarageSale Problem, it is caused by how OSX handles Scripts!

Maybe I am too dumb to do so or maybe the function does not work as expected - but I am not able to use the ebay shipping service commands…

I don´t even get the included script example to work:

tell application "GarageSale 7"
	repeat with theListing in (get use store)		
		set theOption to (the isShipped of theListing)		
		tell theOption
			repeat with theName in (get available domestic shipping service names)
				log "Name: " & theName
			end repeat			
			add shipping service service name "FedEx Priority Overnight"
			repeat with theService in every ebay shipping service
				log "Name: " & service name of theService & " -> " & fee amount of theService
				set fee amount of theService to 44.0
			end repeat
			(* use this to delete the attribute again *)
			-- remove shipping service service name "FedEx Priority Overnight"
		end tell
	end repeat
end tell

gives me an error “use store can´t be read” which I understand, because: What should “use store” do in that case?
If I change the line with “use store” to "repeat with theListing in (get selected ebay listings), I get an error in the next line “set theOption to (the isShipped of theListing)” - because what should “isShipped” do here?
When I now replace the line with “isShipped” with “set theOption to (shipping option of theListing)”, the fee is set to “44” correctly, but …

Stop, I will reply shortly to my own request, found something…


#2

The Apple Script example “Change Shipping Options” is not doing what it should do, please review the examples (mine were included in version 7.0.14b5 (834)), some seem to be odd.

The Example “Change Shipping Options” should more be like this:

tell application "GarageSale 7"
  repeat with theListing in (get selected ebay listings)
	set theOption to (shipping option of theListing)
	tell theOption
		repeat with theName in (get available domestic shipping service names)
			log "Name: " & theName
		end repeat
		add shipping service service name "Hermes Paket"
		repeat with theService in every ebay shipping service
			log "Name: " & service name of theService & " -> " & fee amount of theService
			set fee amount of theService to 44.0
		end repeat
		(* use this to delete the attribute again *)
		-- remove shipping service service name "FedEx Priority Overnight"
	end tell
  end repeat
end tell

This seems to work.


#3

OK, it seems that i finally figured out what the problem may be with the AppleScript Examples: I have GarageSale 6 and 7 on the same machine running. GS6 is named “GarageSale”, GS7 is named “GarageSale 7”. When opening an AppleScript Example of GS7, Script Editor or Script Debugger seem to try to parse/translate all the commands with the dictionary of GS6, so commands that are not present in GS6 are replaced with odd commands - thats what drove me nuts here.
So: If you use AppleScript, avoid to have GaragesSale 67 and 7 on the same machine, this will cause funny things!


#4