On several occasions, Spanish pharmacists have refilled prescriptions from the (Canadian) medicine bottles without any other formality. The first time I needed to do so, I had gone to the centro de salud in Jaca to have a prescription properly written up by a doctor and he told me not to bother but just to go to the pharmacy down the street. "No es narcotico," he told me and shooed me out of his office.
After some discussion about the doctor's resemblance to George Clooney albeit with short legs (initiated by the pharmacist-- her assistant agreed that the doctor was muy guapo), they refilled the prescription, charging me under half the Canadian price (same manufacturer). I know other pilgrims who have followed the practice of just giving the pharmacist their pill bottle and it works for them. However, with amphetamines, which may or may not be (I have no idea) a more restricted drug in Spain, you would do well to take care to have the prescription available. And it's always possible that the pharmacist may determine that they would rather you be seen by a physician before filling the prescription.
I always advise prospective pilgrims to scan their prescriptions and save them as attachments in their draft folder, where they can easily get access to them on their smartphones or on a local computer (libraries or casas culturales usually have terminals for public use). As well, I get to be a bore telling them that , should they have a complex medical condition, the;y should take the trouble to have their physician write up a protocol (in Ontario they usually charge $100-$150 for this-- the province does not cover it), and then take it to a medical translator (not Senor Google!!-- the local medical academy will give you a list) to have it turned into professional castellano. Should you need treatment, this will likely save you hours, and sometimes this is rather important. Medicalert bracelets are also handy for diabetics, in case they become unconscious.