{"id":21064,"date":"2018-04-03T11:15:30","date_gmt":"2018-04-03T15:15:30","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=21064"},"modified":"2025-07-03T18:45:35","modified_gmt":"2025-07-03T22:45:35","slug":"adding-applescriptobjc-to-existing-scripts","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/04\/03\/adding-applescriptobjc-to-existing-scripts\/","title":{"rendered":"Adding AppleScriptObjC to Existing Scripts"},"content":{"rendered":"<p><a href=\"https:\/\/latenightsw.com\/adding-applescriptobjc-to-existing-scripts\/\">Shane Stanley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/latenightsw.com\/adding-applescriptobjc-to-existing-scripts\/\">\n<p>The script runs fine (assuming you have a file called <code>Test.txt<\/code> on your Desktop), until you uncomment the <code>use framework<\/code> line, after which you get the error: &ldquo;Can&rsquo;t make current application into type file.&rdquo; That&rsquo;s not very helpful.<\/p>\n<p>The solution is to change the code so you build file references using coercions.<\/p>\n<p>In other words, <code>as alias<\/code> instead of using a string that represents a path. I usually use <code>POSIX file \"path\"<\/code>, and that also works.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Shane Stanley: The script runs fine (assuming you have a file called Test.txt on your Desktop), until you uncomment the use framework line, after which you get the error: &ldquo;Can&rsquo;t make current application into type file.&rdquo; That&rsquo;s not very helpful. The solution is to change the code so you build file references using coercions. In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-04-12T01:13:09Z","apple_news_api_id":"d577edba-15c4-4aac-bb5f-cb399e93e74a","apple_news_api_modified_at":"2025-07-03T22:45:38Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/A1XftuhXESqy7X8s5npPnSg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[2786,159,650,30,1529,71],"class_list":["post-21064","post","type-post","status-publish","format-standard","hentry","category-technology","tag-aliases","tag-applescript","tag-applescriptobjc","tag-mac","tag-macos-10-13","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=21064"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21064\/revisions"}],"predecessor-version":[{"id":21065,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/21064\/revisions\/21065"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=21064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=21064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=21064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}