opening a .jpeg-file in a folder with Applescript
I am trying to change the names of .jpeg files into the names of the corresponding music albums in a folder.
As far as my knowledge of Applescript goes, the following script should do the job, but it does not open the .jpeg file, i.e. document 1
tell application "FileMaker Pro"
activate
set url_path to cell "bestandspad_cover" of current record
set album_title to cell "album title" of current record & ".jpeg"
end tell
----------------------------------------------------
tell application "System Events"
try
openurl_path
if not (exists url_path) then
display dialog "not found"
else
display dialog "path=" & url_path
opendocument 1
--error number -1719 from document 1
set name of document 1 to album_title
display dialog & name of document 1
closedocument 1 savingyes
end if
end try
end tell
-------------------------------------------------
I work in an FMP environment, but that should not bother you. I am using the Applescript editor to simulate the actual situation.
I tried 'open', 'get' and 'getURL', to no avail; in my experience Applescript sometimes requires illogical, or say imaginative solutions.
Do you see one?
iMac, OS X Mountain Lion (10.8.2), FileMaker Pro 11; iTunes 11.0.1 (12