How do I put citations into separate brackets and still have them grouped when consecutive?

I’m using the IEEE style and it’s currently set to display as [1, 2] or [3–5], but I want to also show my cited page numbers.

I’ve been using Zotero, before recently switching to Endnote, where it’s displayed as follows: [1], [2, p. 45] or [3]–[5] if no page numbers are cited. 

I’ve been playing around with Endnote for ages now and I’ve gotten it to half-work. The citations are shown as expected when a comma is needed, i.e. 2 citations or multiple citations with page numbers. But when trying to group consecutive citations without page numbers it doesn’t work – it displays as [3], [4], [5]. 

I’ve got the citation set as [Bibliography Number, p.^pp. Cited Pages] and the separator as ], [. The consecutive citation grouping is enabled. 

I’d really appreciate any help with this.

Are “Link To Adjacent Text” commands inserted from the comma to the “.^pp. and Cited Pages segments? Can’t tell from your text example. The Link to Adjacent Text command prevents the comma and dependent segments from appearing if the field is empty. Can you attach your output style file?

Hi!! Were you able to get it work? I am really struggling with doing this. Please upload your output style or suggest the code if possible. Thanks!!