Hi,
I am having this piece of code to generate the images name. I want to generate only missing images, not all images, what should to do.
Please advice me on it.
tell application "QuarkXPressâ„¢ 4.11"
activate
-- set myDoc to document 1
tell document 1
set Doc_Name to name
set file_path to file path as string
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set Parent_Path to (text items 1 thru -2 of file_path as string) & ":"
set AppleScript's text item delimiters to ASTID
set thePic to (count of picture box) as integer
repeat with x from 1 to thePic
set ImgPath to file path of image x
set AppleScript's text item delimiters to ":"
set ImgName to last text item of (ImgPath as string)
set ImgName to ImgName & "
"
set AppleScript's text item delimiters to ""
my write_Report(Doc_Name, ImgName, Parent_Path)
end repeat
end tell
end tell
on write_Report(Doc_Name, ImgName, Parent_Path)
set The_Report to Parent_Path & Doc_Name & "“Missing Images.txt"
try
open for access file the The_Report with write permission
write ImgName to file the The_Report starting at eof
close access file the The_Report
on error
close access file the The_Report
end try
end write_Report
Thanks
Rajeev
Hi All,
This is the another script which is generating the missing fonts report, I want the same type of script to generate the missing image report.
Pleas do some needful.
set Input_Folder to choose folder with prompt "Choose folder has Quark Files" without invisible
tell application "Finder"
set Quark_Files to files in Input_Folder
if (not (exists folder ((Input_Folder as string) & "SUCCESS"))) then
set Good_Folder to make new folder at Input_Folder with properties {name:"SUCCESS"}
else
set Good_Folder to folder ((Input_Folder as string) & "SUCCESS")
end if
if (not (exists folder ((Input_Folder as string) & "FAILURE"))) then
set Bad_Folder to make new folder at Input_Folder with properties {name:"FAILURE"}
else
set Bad_Folder to folder ((Input_Folder as string) & "FAILURE")
end if
end tell
tell application "Finder" to set item_list to every file of Input_Folder
tell application "QuarkXPressâ„¢ 4.11"
repeat with this_item in item_list
open the file (this_item as string) use doc prefs yes remap fonts no do auto picture import yes without reflow
set Doc_Name to name of the front document
tell application "QuarkXPressâ„¢ 4.11"
activate
tell document 1
set Doc_Name to name
set Doc_Name to Doc_Name as string
set file_path to get the file path
set file_path to file_path as string
set Missing_Fonts to {}
set Font_List to font list
repeat with This_Font in Font_List
if ID of This_Font as number < 0 then
set end of Missing_Fonts to name of This_Font & return
end if
end repeat
set file_path to file path -- as text
set file_path to file_path as string
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set Parent_Path to (text items 1 thru -2 of file_path) & "FAILURE:"
set Parent_Path to Parent_Path as string
set AppleScript's text item delimiters to ASTID
if Missing_Fonts is not {} then
set Missing_Fonts to Missing_Fonts as string
display dialog Missing_Fonts
my write_Report(Doc_Name, Missing_Fonts, Parent_Path)
close saving no
end if
end tell
end tell
end repeat
end tell
on write_Report(Doc_Name, Missing_Fonts, Parent_Path)
set The_Report to Parent_Path & Doc_Name & "“Missing Fonts.txt"
try
open for access file the The_Report with write permission
write Missing_Fonts to file the The_Report starting at eof
close access file the The_Report
on error
close access file the The_Report
end try
end write_Report
Thanks
Hi Rajeev,
Do it like as given
tell application “QuarkXPress”
activate
– set myDoc to document 1
tell document 1
set Doc_Name to name
set file_path to file path as string
set ASTID to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to “:”
set Parent_Path to (text items 1 thru -2 of file_path as string) & “:”
set AppleScript’s text item delimiters to ASTID
set thePic to (count of picture box) as integer
repeat with x from 1 to thePic
set ImgPath to file path of image x
if (missing of image x is true) then --This is added new
set AppleScript’s text item delimiters to “:”
set ImgName to last text item of (ImgPath as string)
set ImgName to ImgName & "
"
set AppleScript’s text item delimiters to “”
my write_Report(Doc_Name, ImgName, Parent_Path)
end if
end repeat
end tell
end tell
on write_Report(Doc_Name, ImgName, Parent_Path)
set The_Report to Parent_Path & Doc_Name & ““Missing Images.txt”
try
open for access file the The_Report with write permission
write ImgName to file the The_Report starting at eof
close access file the The_Report
on error
close access file the The_Report
end try
end write_Report
Vaasu
Browser: Firefox 2.0.0.14
Operating System: Mac OS X (10.4)
Dear Vaasu,
Thanks, it is working fine.