Problem getting latitude and longitude

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Problem getting latitude and longitude

Postby Wandy » Fri Sep 22, 2017 7:37 am

I am new to Apple Script and need some help. I have been trying to get the latitude and longitude from a selected image. I grabbed some code that works (Thanks Eric) to get crop size and put in the EXIF latitude in the code and get error 1728.

Here is the code.

tell application "Capture One 10"
set my_variants to selected variants
repeat with item_ctr from 1 to count of my_variants
set size_settings to (get EXIF latitude of item item_ctr of my_variants)
-- do other things...
end repeat
end tell

What am I doing wrong?

Thanks in advance,
Bill
Wandy
 
Posts: 6
Joined: Thu Nov 29, 2012 9:32 pm

Re: Problem getting latitude and longitude

Postby rapdigital » Sat Sep 23, 2017 6:14 am

I think you need to get the parent image first

Code: Select all
tell application "Capture One 10"
   set my_variants to selected variants
   repeat with item_ctr in my_variants
      set item_ to (get parent image of item_ctr)
      set size_settings to EXIF latitude of item_
      display dialog size_settings
   end repeat
end tell


OR

Code: Select all
tell application "Capture One 10"
   set my_variants to selected variants
   repeat with item_ctr in my_variants
      set item_ to (get EXIF latitude of parent image of item_ctr)
      display dialog item_
   end repeat
end tell
rapdigital
Certified Professional
Certified Professional
 
Posts: 155
Joined: Mon Feb 02, 2009 1:52 pm

Re: Problem getting latitude and longitude

Postby Wandy » Sun Sep 24, 2017 6:10 pm

Hi Rick,

Thanks for the help. I learned a few things here! I won't go to bed so stupid tonight!

Here is what I ended up with.

Code: Select all
tell application "Capture One 10"
   set my_variants to selected variants
   repeat with item_ctr in my_variants
      set item_ to (get parent image of item_ctr)
      set GPS to {EXIF latitude, EXIF longitude} of item_
   end repeat
end tell


The next challenge will be appending a URL but I think I am on the way. Waiting for the correct url at the moment.

Thanks again for the help,
Bill
Wandy
 
Posts: 6
Joined: Thu Nov 29, 2012 9:32 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest