Hi All
set file_path to get file name of image 1 as text
I am using this command to get file name of an image. But it is showing errors.
Please suggest me the correct code.
Thanks
Hi All
set file_path to get file name of image 1 as text
I am using this command to get file name of an image. But it is showing errors.
Please suggest me the correct code.
Thanks
I’d use the file path for this.
If you have selected the image directly (with the direct selection tool):
set ImgPath to file path of selection
set AppleScript's text item delimiters to ":"
set ImgName to last text item of (ImgPath as string)
set AppleScript's text item delimiters to ""
If you hav selected the image box (e.g. with the object selection tool):
set ImgPath to file path of image 1 of selection
set AppleScript's text item delimiters to ":"
set ImgName to last text item of (ImgPath as string)
set AppleScript's text item delimiters to ""
If you have selected nothing, you’ll have to figure out the box id and (maybe) the page either:
set ImgPath to file path of image 1 of picture box k of page i
set AppleScript's text item delimiters to ":"
set ImgName to last text item of (ImgPath as string)
set AppleScript's text item delimiters to ""
It depands strongly on the context of your script.
Tobias