Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Open a file in PhotoshopCS

 
   Mac (Home) -> Apple Scripts RSS
Next:  Finder label texts  
Author Message
Bruno

External


Since: Jun 21, 2005
Posts: 5



(Msg. 1) Posted: Tue Jun 21, 2005 5:53 am
Post subject: Open a file in PhotoshopCS
Archived from groups: alt>comp>lang>applescript (more info?)

I would open an image with photoshop and do some action.

I try this 2 scripts:

set the topLevelFolder to (choose folder) as string
tell application "Finder"
set fileList to name of every file of folder topLevelFolder as
list
end tell
repeat with oneFile in fileList
set oneFile to oneFile as string

set theFile to topLevelFolder & oneFile
tell application "Adobe Photoshop CS"
open theFile
do script "save action"
end tell
end repeat

This script give an error "Photoshop don't know open message"
(in french: Erreur dans Adobe Photoshop CS :
"Calvin:Users:calvin:Desktop:script:CRW_1381.jpg" ne comprend pas le
message open.)


on run
set theFolder to choose folder
openImages(theFolder)
end run

on open {theFolderItems}
openImages(theFolderItems)
end open

on openImages(theFolder)
tell application "Finder"
set itemList to files in theFolder
repeat with an_item in itemList
tell application "Adobe Photoshop CS"
activate

open an_item
-- put your actions / scripts here
-- do script "page1"
end tell
end repeat
end tell
end openImages

This script open the image with Preview

What's wrong ?
Back to top
Login to vote
J. Stewart

External


Since: Jun 21, 2005
Posts: 16



(Msg. 2) Posted: Tue Jun 21, 2005 5:53 am
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1gyhro1.10jiox31rqqmumN%bpesenti_pala@mac.com>, Bruno
<bpesenti_pala.DeleteThis@mac.com> wrote:

> I would open an image with photoshop and do some action.
>
> I try this 2 scripts:
>
> set the topLevelFolder to (choose folder) as string
> tell application "Finder"
> set fileList to name of every file of folder topLevelFolder as
> list
> end tell
> repeat with oneFile in fileList
> set oneFile to oneFile as string
>
> set theFile to topLevelFolder & oneFile
> tell application "Adobe Photoshop CS"
> open theFile
> do script "save action"
> end tell
> end repeat
>
> This script give an error "Photoshop don't know open message"
> (in french: Erreur dans Adobe Photoshop CS :
> "Calvin:Users:calvin:Desktop:script:CRW_1381.jpg" ne comprend pas le
> message open.)
>

I can't cover the Photoshop "do script" but here's what is happening
with the rest of your script.

In the first line you convert an alias to a string, this conversion
isn't needed.

In the Finder "tell", you don't need to get the name, what you want is
an alias to each file.

In the repeat loop you are telling PhotoShop to open a string which it
can not do. This is a trap we've all fallen into. Smile

Assuming your Photoshop action works correctly, this should work for
what you are attempting.

--> cut <--
set the topLevelFolder to (choose folder)
tell application "Finder"
set fileList to every file of folder topLevelFolder
end tell

tell application "Adobe Photoshop CS"
repeat with oneFile in fileList
open (contents of oneFile)
do script "save action"
end repeat
end tell
--> cut <--

> on run
> set theFolder to choose folder
> openImages(theFolder)
> end run
>
> on open {theFolderItems}
> openImages(theFolderItems)
> end open
>
> on openImages(theFolder)
> tell application "Finder"
> set itemList to files in theFolder
> repeat with an_item in itemList
> tell application "Adobe Photoshop CS"
> activate
>
> open an_item
> -- put your actions / scripts here
> -- do script "page1"
> end tell
> end repeat
> end tell
> end openImages
>
> This script open the image with Preview
>
> What's wrong ?

You have the Photoshop "tell" within a Finder "tell", the script is
confused. Try this instead.

--> cut <--
on run
set theFolder to choose folder
openImages(theFolder)
end run

on open {theFolderItems}
openImages(theFolderItems)
end open

on openImages(theFolder)
tell application "Finder"
set itemList to files in theFolder
end tell
repeat with an_item in itemList
tell application "Adobe Photoshop CS"
activate
open (contents of an_item)
-- put your actions / scripts here
-- do script "page1"
end tell
end repeat
end openImages
--> cut <--

--
Use ROT-13 on the email address for email replies
Back to top
Login to vote
Bruno

External


Since: Jun 21, 2005
Posts: 5



(Msg. 3) Posted: Tue Jun 21, 2005 6:22 am
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Config:

Mac OS X Tiger 10.4.1
Adobe Photoshop CS
Back to top
Login to vote
Dave Balderstone

External


Since: Aug 05, 2005
Posts: 68



(Msg. 4) Posted: Tue Jun 21, 2005 7:24 am
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1gyhro1.10jiox31rqqmumN%bpesenti_pala@mac.com>, Bruno
<bpesenti_pala.DeleteThis@mac.com> wrote:

> open theFile

Try

open file theFile

instead

--
~ Stay Calm... Be Brave... Wait for the Signs ~
------------------------------------------------------
One site: <http://www.balderstone.ca>
The other site, with ww links<http://www.woodenwabbits.com>
Back to top
Login to vote
J. Stewart

External


Since: Jun 21, 2005
Posts: 16



(Msg. 5) Posted: Tue Jun 21, 2005 4:36 pm
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <210620050724471271%dave@N_O_T_T_H_I_S.balderstone.ca>, Dave
Balderstone <dave RemoveThis @N_O_T_T_H_I_S.balderstone.ca> wrote:

> > open theFile
>
> Try
>
> open file theFile
>
> instead

Or maybe, because it's unequivocal (demo uses Tex-Edit Plus and a text
file on my desktop) ->

set p2app to alias ((path to "apps" as Unicode text) & "Tex-Edit Plus
4.7.0:Tex-Edit Plus.app")
set f2open to alias ((path to "desk" as Unicode text) & "sharing.txt")

tell application "Finder" to open f2open using p2app

Where "f2open" is the path to the file (as an alias) and "p2app" is the
path to the application (as an alias) with which to open it. Just
substitute your file(s) and Photoshop as appropriate.

--
Use ROT-13 on the email address for email replies
Back to top
Login to vote
Bruno

External


Since: Jun 21, 2005
Posts: 5



(Msg. 6) Posted: Tue Jun 21, 2005 5:21 pm
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

J. Stewart <cfnzrpu RemoveThis @crevtrr.arg> wrote:

Thanks for your answer.

>
> --> cut <--
> set the topLevelFolder to (choose folder)
> tell application "Finder"
> set fileList to every file of folder topLevelFolder
> end tell
>
> tell application "Adobe Photoshop CS"
> repeat with oneFile in fileList
> open (contents of oneFile)
> do script "save action"
> end repeat
> end tell
> --> cut <--
>

This scripts work fine.
But the jpeg must be set to be opened by Photoshop (Commande-I in the
finder) else Preview will open them.
>
> --> cut <--
> on run
> set theFolder to choose folder
> openImages(theFolder)
> end run
>
> on open {theFolderItems}
> openImages(theFolderItems)
> end open
>
> on openImages(theFolder)
> tell application "Finder"
> set itemList to files in theFolder
> end tell
> repeat with an_item in itemList
> tell application "Adobe Photoshop CS"
> activate
> open (contents of an_item)
> -- put your actions / scripts here
> -- do script "page1"
> end tell
> end repeat
> end openImages
> --> cut <--

This scripts open the images with Preview, not Photoshop.
Back to top
Login to vote
Bruno

External


Since: Jun 21, 2005
Posts: 5



(Msg. 7) Posted: Wed Jun 22, 2005 6:48 am
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dave Balderstone <dave RemoveThis @N_O_T_T_H_I_S.balderstone.ca> wrote:

>
> Try
>
> open file theFile
>
> instead

Work fine Smile
Thanks Dave.
Back to top
Login to vote
Bruno

External


Since: Jun 21, 2005
Posts: 5



(Msg. 8) Posted: Wed Jun 22, 2005 6:48 am
Post subject: Re: Open a file in PhotoshopCS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

J. Stewart <cfnzrpu DeleteThis @crevtrr.arg> wrote:

> In the repeat loop you are telling PhotoShop to open a string which it
> can not do. This is a trap we've all fallen into. Smile
>
> Assuming your Photoshop action works correctly, this should work for
> what you are attempting.

Thanks for the debugging and the explain.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
open location in background - Hi, using "open location <url>" from StandardAdditions always brings the browser to foreground. Any way to prevent that? -- Tobias Weber

File Reference - Can anyone tell me why this works: set fileName to "foo" set filePath to "HD:Users:abc:" set theFile to filePath & fileName set fileRef to open for access theFile with write permission set eof fileRef to 0 write "test" ...

Zip a file - Hey, Everyone. I want to create an applescript that zips a file and plunks it in an "Archieve" folder. I could uses automator, but it wont pipe the name of the file and prepend it to the new zip file. I don't know how to run a zip command fr...

alias from posix file - Hi! I have an absolute unix file name as a astring and need an alias object that iTunes will accept. How? Did not work: (posix file "/a/b.mp3") as alias -- Tobias Weber

create a file association with applescript - Hi, i need a way to create an association between a specific file extansion ".xyz" and a specific application.
       Mac (Home) -> Apple Scripts All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact