Positioning Layer Relative to Guides
I have two files I will call file a and file b. File a is a template, it is 1335x5400 pixels, single layer, and has a single horizontal guide at exactly 1300 pixels from the top. File b is variable size, single layer, and can have a single horizontal guide anywhere. I need to take File b, resize it, and copy it into File a, then move it to a specific location. The location differs depending on whether or not there is a guide in File b.
What I am currently doing is opening File a, then opening File b, resizing the image, duplicating the active layer to File a, switching to File a, repositioning the layer to the desired location, exporting the resulting image, and then closing both files. This works great. However, I have no clue as to how I could possibly duplicate the guides from File b to File a (I am not really sure I would need to do that either) and how to align the layer using this guide.
I would much appreciate it if someone could post example code. Thank you very much in advance.