Applescript: How to get Path of an Image
Two questions:
1) How do I get the path of an image?
2) Is there a way to update that path, or move the image into another folder, via Applescript.
Right now, getting the path is proving difficult. I can run a script like:
This produces an error: Can’t get path of image 1 of document "GeneralUseSession.cosessiondb"." number -1728 from path of image 1 of document "GeneralUseSession.cosessiondb"
If i try
set the path to (path of image 1) as text
I get the error
Can’t make «class COdl» of «class cimg» 1 of document "GeneralUseSession.cosessiondb" of application "Capture One 9" into type text." number -1700 from «class COdl» of «class cimg» 1 of document "GeneralUseSession.cosessiondb" to text
But, if I ask for:
properties of image i
I get
{dimensions:{3648, 2736}, path:"path to myfile", name:"myfile.CR2", class:image, id:"path to my file"}
Clearly there is a path property there. I just can't read it. Can anyone tell me how? Is there a way to change it in Applescript?
Thanks,
Gary
1) How do I get the path of an image?
2) Is there a way to update that path, or move the image into another folder, via Applescript.
Right now, getting the path is proving difficult. I can run a script like:
tell application "Capture One 9"
tell document "GeneralUseSession.cosessiondb"
set thepath to (path of image 1)
end tell
end tellThis produces an error: Can’t get path of image 1 of document "GeneralUseSession.cosessiondb"." number -1728 from path of image 1 of document "GeneralUseSession.cosessiondb"
If i try
set the path to (path of image 1) as text
I get the error
Can’t make «class COdl» of «class cimg» 1 of document "GeneralUseSession.cosessiondb" of application "Capture One 9" into type text." number -1700 from «class COdl» of «class cimg» 1 of document "GeneralUseSession.cosessiondb" to text
But, if I ask for:
properties of image i
I get
{dimensions:{3648, 2736}, path:"path to myfile", name:"myfile.CR2", class:image, id:"path to my file"}
Clearly there is a path property there. I just can't read it. Can anyone tell me how? Is there a way to change it in Applescript?
Thanks,
Gary
0
-
Maybe viewtopic.php?t=22684 can help a little?
Cheers,
Peter.0
Post is closed for comments.
Comments
1 comment