[Script] WME AltCity v.20241129001

WME AltCity is a script that simplifies adding an alternate street to one or more segments, with the same name but a different city than the primary street. Requires GreaseMonkey.

Download here.

FYI, if you have installed WME ClickSaver, which also has an “Add Alt City” control, this script will hide the ClickSaver link, but will not interfere with any of the other features of that script.

1 Like

Does this script function in any way differently than the ClickSaver version of this task?

Yes. The primary difference is that you can select multiple segments, even with different street names, and the script will add the new city name to each one (with the segment’s original street name kept intact).

This is really proving to be an excellent tool when working/resolving routing issues with RPPs, in rural areas … of which we have a LOT. Simple and effective. Thanks.

I’m glad someone else took up the responsibility of doing this…it’s been on my I-should-do-this-but-I-hate-working-with-segment-naming list for a year :slight_smile:

After some quick testing, it seems that this doesn’t work if the city name is not already seeded in the area such that it comes up in the autocomplete drop down, but setting the city name still allows the script to increment the change counter and for it to save, but no changes are made.

Thank you so much! What a wonderful time saver!

It was by design that it doesn’t work if the city name is not already seeded in the area, but it was not by design that the change counter will increment in that situation. Let me take a look at that.

Updated to version 20180807.1: Fix phantom save issue.

I love this script! Thanks you so much. However, in WME beta I get errors with this message

Well, that’s perfectly self-explanatory, isn’t it? :lol:

It seems that something has changed in the Beta API, but it will probably take some time for me to figure out what. The script does work if the alt-name you’re adding already exists on the map (for example, one segment has the alt city but the next segment of the same street doesn’t), but that’s not especially useful.

Hello,
I was faced to the same problems and I found a solution for it.

Thanks to vtnerd91 who show me the way to “Waze/Action/UpdateFeatureAddress” here
And I do the same thing for “Waze/Action/AddAlternateStreet”.
In fact, there is no need to use “addorgetcity” and “addorgetstreet”.
All is included in the new functions

[code]var WazeActionAddAlternateStreet = require(“Waze/Action/AddAlternateStreet”);
var WazeActionUpdateFeatureAddress = require(“Waze/Action/UpdateFeatureAddress”);

function add_Alternative_Street (sel, country_ID, state_ID,city_Name, street_Name) {
var attr = {
countryID: country_ID,
stateID: state_ID,
cityName: city_Name,
emptyCity: (city_Name==‘’),
streetName: street_Name,
emptyStreet: (street_Name==‘’)
};
return new WazeActionAddAlternateStreet(sel, attr,{ streetIDField: “streetIDs”});
}

W.model.actionManager.add (add_Alternative_Street(sel,city.attributes.countryID,city.attributes.stateID,cityName,streetName));

function changeStreetAdress (sel, country_ID, state_ID,city_Name, street_Name) {
var attr = {
countryID: country_ID,
stateID: state_ID,
cityName: city_Name,
emptyCity: (city_Name==‘’),
streetName: street_Name,
emptyStreet: (street_Name==‘’)
};
return new WazeActionUpdateFeatureAddress(sel, attr,{ streetIDField: “primaryStreetID”});
}

W.model.actionManager.add(changeStreetAdress (sel, city.attributes.countryID, city.attributes.stateID,city.attributes.name, newName));[/code]

Thanks! I had independently come up with a similar, but different, solution to the problem. The new version 20180824.1 is now available on GreasyFork.

From my side, I have solved my problems and I see that it’s the same thing for you.
I check this topic about a script which use some similar functions than CRN (but it’s in french ;))
We are few to use directs modifications by scripts in WME, perhaps we will need some helps in the future :wink:

The latest WME update seems to have broken your script. It is very valuable, so I hope you have time to get it back up and running. Thank you.

Sean

:white_check_mark: Done; new version 20190227.1 now available.

Thank you so much!

Sean

I have a suggestion/idea that might make it easier to use and save some problems. I recently had a few streets change direction on me while using the alt city script. It turned out that I didn’t realize the cursor was not in the field after clicking the alt city link. I started to spell the city and the keyboard shortcut keys were active and it changed street directions on me. (Zirconia) was the city name an when I hit the “r” it went from 2 direction to A>B. Would it be possible to change the script so that when you click the alt city link that the focus goes to the field you are going to type the city in, that makes sense since it’s why you clicked on it in the first place. Great script by the way. Very useful for changing multiple segments at once.

Done in v.20190429.1.

THANKS!!!

Nice addition. I have had the change issue too, but @pcbman figured out the words to use! Nice job.

Sean