How to capture my location in a draft

I have an action the writes my Draft to Google Drive txt file for a trip journal. It captures the date and time. How do I capture and add my location (eg London, Boston, etc) to the journal?

Longitude and Latitude are captured as meta data if you have location enabled for Drafts. If you need a city/region, you could get Apple shortcuts to convert those coordinates to an area and then either return that into Drafts to be set as a custom templat tag, or you could have your action get Shortcuts to run the whole export.

I have a similar script that I use to get my latitude & longitude with:

var tempDraft = Draft.create();
var latlong = tempDraft.processTemplate("[[latitude]],[[longitude]]");

After that, I reverse geocode it with:

try {
    // TODO Change to MapTiler API which is cheaper and provides better results.
    let credential = Credential.create("Google Maps API", "Google Maps API Token from a Google Cloud Project");
    credential.addPasswordField("google_maps_api_key", "Google Maps API Key");
    credential.addTextField("google_maps_project_id", "Google Maps Project ID");
    credential.authorize();

    var url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + latlong + '&result_type=street_address&key=' + credential.getValue("google_maps_api_key");

    var http = HTTP.create();
    var response = http.request({
        "url": url,
        "method": "GET"
    });

    if (response.success) {
        var data = JSON.parse(response.responseText);
        if (data.status === 'OK' && data.results && data.results.length > 0) {
            formattedAddress = data.results[0].formatted_address;
        } else {
            formattedAddress = "No address found";
        }
    } else {
        formattedAddress = "Error fetching address: " + response.statusCode;
    }
} catch (e) {
    console.log(e);
    formattedAddress = "Error fetching address";
}