Jump to content
Server Maintenance This Week. ×

Applescript in Layout mode


This topic is 5740 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I've got an icon in photoshop, 50px by 50px. For Reasons to Become Apparent Later, I'd like to recreate this icon as single coloured pixels in FileMaker. Obviously, creating a couple of thousand pixels isn't my idea of a good time. I was hoping to AppleScript it.

Can I AppleScript layout mode to the extent of 'make a rectangle, colour it this colour, position it here'? If so, then I can script Photoshop to get each individual pixel's colour, then go to filemaker and recursively make them; if not, then I guess I have a few evenings' tedium in front of me.

Help much appreciated.

Hamish

Link to comment
Share on other sites

Can't be done. But you could make 50 fields with 50 repetitions and script or calculate the colors.

Or you could type a period (.) on the layout; give it an object name; then conditionally format it based on the object name... maybe use a custom function...

Huh? Who said that?

Link to comment
Share on other sites

This would be a job for repeating fields. Then you'd only need 50 fields each with 50 repetitions. Get the first field right and duplicate it 49 times.

Link to comment
Share on other sites

I believe it could be done by using GUI scripting:

http://www.apple.com/applescript/uiscripting/

Though I'd be interested to know what advantage can there be in having an image broken into individual pixels (unlike a graduated background made out of grouped lines, that can be stretched in one direction).

Link to comment
Share on other sites

I'm curious about that too. "For Reasons to Become Apparent Later," so mysterious.

I can't quite picture doing this with GUI scripting, but maybe it's possible. Another option that I think would be easier to program is some kind of macro utility.

Link to comment
Share on other sites

  • Newbies

;) Maybe I should've put 'reasons that are too boring to go into but which I think are reasonable'! I'd just prefer to have them, that's all.

I think that the best/only way to do it would be to combine it with Extra Suites and use mouse clicks in Filemaker. I can reasonably easily get the colour of each pixel in Photoshop, but it's the creation in FileMaker that would be hard. I can script the menus, but resizing would be hard. That's where Extra Suites comes in - if I put the Info box at the top left of the screen, I know its position, and I could get ES to click in the right box and then keystroke the width and height.

It might be interesting as a technical exercise, but I think isn't really worth it in the long run - as you say, images would work ok. I'll report back if I manage to get something working - it could be an amusingly kludge-based script for people to roll their eyes at! Thanks to all for the help.

H

Link to comment
Share on other sites

This topic is 5740 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.