Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Disable iPhoto sharing via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Disable iPhoto sharing via AppleScript
Authored by: hypercat on Jun 25, '12 09:48:02AM

I would caution against using:

if running of application "Some App Name" then
-- do something
end if

since if "Some App Name" is not the correct name for the app (i.e. "Filemaker Pro 11" but the app on your system is named "Filemaker Pro 11 Advanced") then you will get the dreaded "Choose Application" modal dialog box asking you "Where is Some App Name?"

One way to avoid the "Choose Application" modal dialog box is to use the application id (creator code):

set nonsense_app_id to "zzxx"
set filemaker_pro_app_id to "FMP7"
set sublime_text_app to "subl"

IsAppRunning(sublime_text_app)

on IsAppRunning(the_app_id)
set is_running to false
try
if running of application id the_app_id is true then
set is_running to true
end if
on error errMsg number errNum
-- if the application id is not recognized then error -1728 is generated
set is_running to false -- unrecognized apps are not running by default
end try
return is_running
end IsAppRunning



[ Reply to This | # ]
Disable iPhoto sharing via AppleScript
Authored by: dhaskew on Jun 25, '12 05:58:43PM

I thought creator codes, and correct me if I am mistaken, where phased out in Lion. Or the phase out was started anyway. Is that not so? I remember some conversation around this topic when Lion was released. What might I have been thinking of?



[ Reply to This | # ]
Disable iPhoto sharing via AppleScript
Authored by: hypercat on Jun 29, '12 02:54:25PM

Creator codes are still used in Lion and you can use the creator codes to identify an application in Lion.

What changed in the OS since Snow Leopard is that files no longer use the creator code to determine which application to use to open the file.

Much more info on this topic is here:
http://tidbits.com/article/10537



[ Reply to This | # ]