What’s happening here actually makes sense once you know how the Eyedropper tool behaves in InDesign.
It can copy fill and stroke attributes, but only if the source object actually has those attributes. In your example, you’re sampling a pink fill from an object that has no stroke, so InDesign reads that as “stroke = none” and applies that to your target, effectively removing its stroke.
You can’t directly take a fill colour from one object and have it automatically apply to the stroke of another that kind of stroke-to-fill swapping only looks possible in Illustrator because of how it handles appearance attributes, but it’s not truly converting one to the other there either.
Here's a basic examaple
Illustrator Stroke
This is how the stroke is applied in Illustrator.
I can't find a way to fill an object with the stroke colour using the eyedropper tool.
But it might only look like a stroked object as a hollowed out rectangle like below.
This would make the fill pink but looks like a stroke.
And when you sample this and apply it in Illustrator sure it fills with the colour as it's filled in illustrator.
It actually has no stroke, you can can see that in the screen shot, the stroke is null with a red stripe in the bottom left.
If you double click the eyedropper tool in Illustrator you get all sorts of functions, maybe a combination of this works for you I haven't tried, but you can see Illustrator has extra things it can pick up and apply - but I haven't played with it - but I can't imagine it would be pick up a stroke and use it as a fill.
The Eyedropper in InDesign options are limited compared to Illustrators
To achieve what you want in InDesign
Sample the stroke
And then use Shift X to swap the stroke with the fill
But I just can't find a way to get Illustrator to behave as you described it, and definitely not InDesign.
Eyedropper tool: can only copy matching attributes (fill to fill, stroke to stroke).
Your Script: forces fill to swap stroke swapping between objects.
InDesign limitation: no native command or option to interchange fill and stroke between different objects.
The script doesn't “fix” a bug, it's just coded around a limitation.
... View more