The problem with Photoshop's file size optimizer is that it is not something that you can include as a Save For Web in an action - that is, the file size optimizer that figures out the compression does not get run for every image in a batch, so when you run the Save For Web when recording the action, the compression that gets computed for the example image is statically used for all of the images in the batch.
Or, if you make the action and run it on one image at a time, same thing.
It may be easier to automate the process if you do some quick experiments in the Save For Web preview window to see what level of compression gives you the file size and quality you want and then just statically use that value for your batch conversion.
Also, if you have a mix of portrait and landscape orientation, don't forget to use the "Automate > Fit Image" command - this is similar to resizing to the long edge in Lightroom.
You action will look something like this:
Automate > Fit Image (3000, 3000, do not enlarge)
Image Size ... Resolution = 300, do not resample
Edit > Covert to Profile ... sRGB
Save to output folder via however you want
HOWEVER...
The most efficient and easiest way to do this is to perform your Photoshop edits on your files at full resolution and save them as "masters" - then do all the downsizing, ppi, and saving to a specific file size with imagemagick, using the "mogrify" command:
magick mogrify -path /Path/to/Output/Directory -format jpg -resize "3000x3000" -density 300 -define jpeg:extent=1500kb *.jpg
You will run this command while in the directory with all of your master images (actually it is better to duplicate your masters and run on a duplicate in case something goes wrong). So, make the directory of all of the images you want to operate on (the duplicates of your masters) the working directory and run the command - it will save JPEGs to the specified Output Directory (in the -path argument) with a long edge of 3000 pixels, a ppi of 300 and a file size of 1.5MB or less. This particular example assumes your input files are JPEGs with the file extension ".jpg" (the last part of the command, *.jpg, means "do this on all of the files (the * wildcard) with the extension .jpg in the current directory.")
Piece of cake.
Imagemagick is scary because it is a command line tool, but it is cross-platform, free, and extremely well-documented so the info you need is out there.
Kirk