Edinburgh is very close to the ocean. It's basically about 3734 meters from the ocean depending on where you measure to the exact coastline.
If you're driving to a town near the beach or coastline, you could try Carnoustie.
How far is Cleveland from the ocean
How far is Encinitas from the ocean
How far is Coral Gables from the ocean
How far is Manhattan Beach from the ocean
How far is Oakland from the ocean
How far is Gettysburg from the ocean
How far is Fort Collins from the ocean
How far is Las Cruces from the ocean
How far is Astoria from the ocean
How far is Basel from the ocean