2016-03-29 26 views
0

Bir .xlsx dosyasına sahibim ve bu dosyayı PDF formatında PDF formatında kaydetmek istiyorum. Bunu iyice araştırdım ama görünüşe göre bir milyon mesele var.Excel'i PDF'ye PDF kullanarak dönüştür (PDF olarak kaydet)

böyle, kodda ... PDF aktif çalışma kitabını dönüştürmek için bir kod yığın yerini olacağını bir .APP olarak kaydetmek için bir şey istiyorum:

tell application "Microsoft Excel" 
    activate 
    open "/somedirectory/workbook1.xlsx" 
    ... 
end tell 

cevap

-1

Buldum! İşte cevabı:

http://blog.krugazor.eu/2010/01/applescript-batch-saving-to-pdf/

yukarıdaki linkten alıntı aşağıdadır:.

"Temel olarak, ne yapar benzetmek tuş vuruşlarını ve tıklama Yani bir şey yapmak için izin verir

bir kullanıcı mümkün olacaktır

Daha fazla ado olmadan, toplu iletişim için AppleScript, yazdırma iletişim kutusunu kullanarak bir grup excel dosyasına kaydedin! "

on open some_items 
    repeat with this_item in some_items 
     try 
      tell application "Microsoft Excel" 
       activate 
       open this_item 
       tell application "System Events" to tell process "Microsoft Excel" 
        --Bring up print window 
        keystroke "p" using command down 
        --Choose "PDF" > "Save as PDF" 
        click (menu button "PDF" of window 1) 
        click (menu item 1 of menu of menu button "PDF" of window 1) 
        delay 2 
        -- Choose the desktop as save locaton (Command-D) 
        keystroke "d" using command down 
        --Save 
        keystroke "s" using command down 
        keystroke return 

        -- wait and close 
        delay 3 
        keystroke "w" using command down 
       end tell 
      end tell 
     end try 
    end repeat 

    tell application "Finder" 
     open desktop 
    end tell 
end open 
+1

Gelecek için, cevabınıza faydalı bulduğunuz bağlantının ilgili bölümlerini dahil edebilir misiniz? Bu şekilde, eğer bağlantı aşağı inerse, değişiyorsa, cevabınız işe yaramaz hale gelmeyecektir. Çok teşekkürler. –

İlgili konular