Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can execute a script fine using apples script pull down on the menu bar. Errors when using FastScri

edited October 2012 in FastScripts
This is a script involving data/image transfer from Media Pro to Filemaker Pro via Applescript. Can execute a script fine using apples script pull down on the menu bar. Errors when using FastScript. Running OS 10.6.8. I get the error on two different machines.

The error I get is:

Error Number:FileMaker Pro got an error: Object not found.
-10006

The script:

tell application "Media Pro"
set itemNumber to 1
tell catalog 1
set itemSelection to selection
set theItemList to media info of every media item as list

set itemCount to count of theItemList
end tell

repeat itemCount times
tell application "Media Pro"

tell catalog 1
set itemSelection to selection
set theItemList to media info of every media item as list
set itemCount to count of theItemList
set widthVar to width of media item itemNumber
set heightVar to height of media item itemNumber
set resolutionVar to resolution of media item itemNumber
set fileType to file type of media item itemNumber
set encodingVar to encoding of media item itemNumber
set fileSize to file size of media item itemNumber
set colorDepth to color depth of media item itemNumber
set colorSpace to color space of media item itemNumber
set colorProfile to color profile of media item itemNumber
set applicationVar to file creator of media item itemNumber
set theFileName to name of media item itemNumber
set theFilePath to path of media item itemNumber
set x to the offset of ":" in (the reverse of every character of theFilePath) as text
set the parent_folder_path to (characters 1 thru -(x) of theFilePath) as text
set parent_folder to last word of parent_folder_path as text

set thumbVar to thumbnail of media item itemNumber
if resolutionVar = 0 then set resolutionVar to 72
set widthVar to widthVar / resolutionVar as real
set widthVar to (round widthVar * (10 ^ 3) rounding up) / (10 ^ 3)
set heightVar to heightVar / resolutionVar
set heightVar to (round heightVar * (10 ^ 3) rounding up) / (10 ^ 3)
set dimensionVar to widthVar & " x " & heightVar as text
set colorProfileName to color profile of media item itemNumber

end tell

if colorProfile = "" then
set colorProfile to "None"
else
set colorProfile to "Profile"
end if

end tell
set the clipboard to thumbVar

set databaseNumber to "GoToFieldPasteClip_" & itemNumber

tell application "FileMaker Pro"
tell database "Custom Color Printer Set-Up"
tell current record
set theFileNameField to "File Name" & itemNumber
set widthVarField to "CM in Width_" & itemNumber
set heightVarField to "CM in Tall_" & itemNumber
set dimensionVarField to "DocumentPageSize_" & itemNumber
set FinalTrimSizeField to "FinalTrimSize_" & itemNumber
set fileTypeField to "DocumentName_" & itemNumber
set colorProfileField to "Rip @_" & itemNumber
set PrintAtField to "Print @_" & itemNumber
--set ReqNumber to "Req #_" & itemNumber
set colorProfileNameField to "Profile_" & itemNumber
if colorProfileName > 0 then
set cell colorProfileNameField to colorProfileName
else
set cell colorProfileNameField to "No Profile"
end if
try
on error
set cell ReqNumber to colorProfileName
end try

set cell theFileNameField to theFileName
set cell widthVarField to widthVar
set cell heightVarField to heightVar
set cell dimensionVarField to dimensionVar
set cell FinalTrimSizeField to dimensionVar
try
set cell fileTypeField to fileType & "-" & applicationVar
on error
set cell fileTypeField to fileType & "" & ""
end try
set cell colorProfileField to colorProfile
set cell "Job ID" to parent_folder
set cell "File Path" to parent_folder_path
set cell PrintAtField to "100%"
do script "Set Field to Technician"

end tell
tell application "FileMaker Pro"

do script FileMaker script databaseNumber
delay 1
end tell
end tell

end tell



set itemNumber to itemNumber + 1

end repeat
end tell



Any ideas?

Comments

  • Hi there - it would help a lot if you can narrow it down to the specific line of the script that is triggering the error in FastScripts. Sometimes this can be done by adding return statements to the script and seeing how far it gets before it errors. It would also help to try to narrow it down to a specific few lines that fail and cause an error in FastScripts vs. the Apple Script Menu. Thanks!
Sign In or Register to comment.